Add karabiner

This commit is contained in:
Leon Kowarschick 2024-02-23 09:30:33 +01:00
parent dc4407fb68
commit cdb1568566
Signed by: ElKowar
GPG key ID: 72C759DA738DE3A2
9 changed files with 3574 additions and 0 deletions

View file

@ -0,0 +1,396 @@
{
"title": "Vimode with smart caps",
"maintainers": [
"Lance1o7"
],
"rules": [
{
"description": "CAPSLOCK + hjkl to arrow keys (Post ESCAPE if press CAPSLOCK alone)",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
},
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "escape"
}
],
"type": "basic"
}
]
},
{
"description": "Post CAPSLOCK if press ESCAPE alone",
"manipulators": [
{
"from": {
"key_code": "escape",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "escape pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "escape pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "caps_lock"
}
],
"type": "basic"
}
]
},
{
"description": "Change left_shift + Command_L to escape only if pressed at the same time.",
"manipulators": [
{
"from": {
"key_code": "left_command",
"modifiers": {
"mandatory": [
"left_shift"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "escape"
}
],
"to_if_alone": [
{
"key_code": "left_command"
}
],
"type": "basic"
}
]
},
{
"description": "Post COMMAND + A/C/V/X/Z to, when CAPSLOCK + A/C/V/X/Z is pressed",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "a",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "c",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "c",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "v",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "v",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "w",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "w",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "x",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "x",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "z",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "z",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "escape"
}
],
"type": "basic"
}
]
}
]
}

View file

@ -0,0 +1,183 @@
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"manipulators": [
{
"description": "Change caps_lock to command+control+option+shift.",
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_shift",
"modifiers": [
"left_command",
"left_control",
"left_option"
]
}
],
"type": "basic"
}
]
}
]
},
"devices": [],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}

View file

@ -0,0 +1,199 @@
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": []
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 832,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 832,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 34304,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}

View file

@ -0,0 +1,696 @@
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "CAPSLOCK + hjkl to arrow keys (Post ESCAPE if press CAPSLOCK alone)",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "home"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "g",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "end"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "d",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"shift"
],
"key_code": "9"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "f",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"shift"
],
"key_code": "0"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "u",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"shift"
],
"key_code": "open_bracket"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "p",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"shift"
],
"key_code": "close_bracket"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "open_bracket"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "o",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "close_bracket"
}
],
"type": "basic"
},
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "escape"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "x",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "n",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_or_backspace"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "r",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "slash"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "t",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "backslash"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "e",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"shift"
],
"key_code": "quote"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "semicolon",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"shift"
],
"key_code": "7"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "quote",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"modifiers": [
"shift"
],
"key_code": "5"
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 832,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 832,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 34304,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0
},
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
]
}

View file

@ -0,0 +1,249 @@
global:
ask_for_confirmation_before_quitting: true
check_for_updates_on_startup: true
show_in_menu_bar: true
show_profile_name_in_menu_bar: false
unsafe_ui: false
profiles:
- complex_modifications:
parameters:
basic.simultaneous_threshold_milliseconds: 50
basic.to_delayed_action_delay_milliseconds: 500
basic.to_if_alone_timeout_milliseconds: 1000
basic.to_if_held_down_threshold_milliseconds: 500
mouse_motion_to_scroll.speed: 100
rules:
- description: CAPSLOCK + hjkl to arrow keys (Post ESCAPE if press CAPSLOCK alone)
manipulators:
- conditions: &conds
- name: caps_lock pressed
type: variable_if
value: 1
from:
key_code: j
modifiers: { optional: [any] }
to: [{ key_code: down_arrow } ]
type: basic
- conditions: *conds
from:
key_code: k
modifiers: { optional: [any] }
to: [{key_code: up_arrow}]
type: basic
- conditions: *conds
from:
key_code: h
modifiers: { optional: [any] }
to: [{ key_code: left_arrow }]
type: basic
- conditions: *conds
from:
key_code: l
modifiers: { optional: [any] }
to: [{key_code: right_arrow } ]
type: basic
- conditions: *conds
from:
key_code: a
modifiers: { optional: [any] }
to: [ { key_code: home } ]
type: basic
- conditions: *conds
from:
key_code: g
modifiers: { optional: [any] }
to: [ { key_code: end } ]
type: basic
- conditions: *conds
from:
key_code: d
modifiers: { optional: [any] }
to:
- modifiers: [shift ]
key_code: '9'
type: basic
- conditions: *conds
from:
key_code: f
modifiers: { optional: [any] }
to:
- modifiers: [shift]
key_code: '0'
type: basic
- conditions: *conds
from:
key_code: u
modifiers: { optional: [any] }
to:
- modifiers: [ shift ]
key_code: open_bracket
type: basic
- conditions: *conds
from:
key_code: p
modifiers: { optional: [any] }
to:
- modifiers: [ shift ]
key_code: close_bracket
type: basic
- conditions: *conds
from:
key_code: i
modifiers: { optional: [any] }
to: [ { key_code: open_bracket } ]
type: basic
- conditions: *conds
from:
key_code: o
modifiers: { optional: [any] }
to: [ { key_code: close_bracket } ]
type: basic
- from:
key_code: caps_lock
modifiers: { optional: [any] }
to:
- set_variable:
name: caps_lock pressed
value: 1
to_after_key_up:
- set_variable:
name: caps_lock pressed
value: 0
to_if_alone:
- key_code: escape
type: basic
- conditions: *conds
from:
key_code: 'x'
modifiers: { optional: [any] }
to: [ { key_code: delete_forward } ]
type: basic
- conditions: *conds
from:
key_code: 'n'
modifiers: { optional: [any] }
to: [ { key_code: delete_or_backspace } ]
type: basic
- conditions: *conds
from:
key_code: 'e'
modifiers: { optional: [any] }
to: [ { key_code: quote, modifiers: ["shift"] } ]
type: basic
- conditions: *conds
from:
key_code: 'r'
modifiers: { optional: [any] }
to: [ { key_code: slash } ]
type: basic
- conditions: *conds
from:
key_code: 't'
modifiers: { optional: [any] }
to: [ { key_code: backslash } ]
type: basic
- conditions: *conds
from:
key_code: 'semicolon'
modifiers: { optional: [any] }
to: [ { modifiers: [shift], key_code: '7' } ]
type: basic
- conditions: *conds
from:
key_code: 'quote'
modifiers: { optional: [any] }
to: [ { modifiers: [shift], key_code: '5' } ]
type: basic
devices:
- disable_built_in_keyboard_if_exists: false
fn_function_keys: []
identifiers:
is_keyboard: true
is_pointing_device: false
product_id: 832
vendor_id: 1452
ignore: false
manipulate_caps_lock_led: true
simple_modifications: []
treat_as_built_in_keyboard: false
- disable_built_in_keyboard_if_exists: false
fn_function_keys: []
identifiers:
is_keyboard: false
is_pointing_device: true
product_id: 832
vendor_id: 1452
ignore: true
manipulate_caps_lock_led: false
simple_modifications: []
treat_as_built_in_keyboard: false
- disable_built_in_keyboard_if_exists: false
fn_function_keys: []
identifiers:
is_keyboard: true
is_pointing_device: false
product_id: 34304
vendor_id: 1452
ignore: false
manipulate_caps_lock_led: true
simple_modifications: []
treat_as_built_in_keyboard: false
fn_function_keys:
- from:
key_code: f1
to:
- consumer_key_code: display_brightness_decrement
- from:
key_code: f2
to:
- consumer_key_code: display_brightness_increment
- from:
key_code: f3
to:
- apple_vendor_keyboard_key_code: mission_control
- from:
key_code: f4
to:
- apple_vendor_keyboard_key_code: spotlight
- from:
key_code: f5
to:
- consumer_key_code: dictation
- from:
key_code: f6
to:
- key_code: f6
- from:
key_code: f7
to:
- consumer_key_code: rewind
- from:
key_code: f8
to:
- consumer_key_code: play_or_pause
- from:
key_code: f9
to:
- consumer_key_code: fast_forward
- from:
key_code: f10
to:
- consumer_key_code: mute
- from:
key_code: f11
to:
- consumer_key_code: volume_decrement
- from:
key_code: f12
to:
- consumer_key_code: volume_increment
name: Default profile
parameters:
delay_milliseconds_before_open_device: 1000
selected: true
simple_modifications: []
virtual_hid_keyboard:
country_code: 0
indicate_sticky_modifier_keys_state: true
mouse_key_xy_scale: 100

View file

@ -0,0 +1,928 @@
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "CAPSLOCK + hjkl to arrow keys",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "home",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "g",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "end",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"simultaneous": [
{
"key_code": "a"
},
{
"key_code": "s"
},
{
"key_code": "d"
}
],
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "u",
"modifiers": [
"left_option"
]
},
{
"key_code": "a",
"modifiers": []
},
{
"key_code": "vk_none",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"simultaneous": [
{
"key_code": "s"
},
{
"key_code": "d"
},
{
"key_code": "f"
}
],
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "s",
"modifiers": [
"left_option"
]
},
{
"key_code": "vk_none",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"simultaneous": [
{
"key_code": "k"
},
{
"key_code": "l"
},
{
"key_code": "semicolon"
}
],
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "u",
"modifiers": [
"left_option"
]
},
{
"key_code": "o",
"modifiers": []
},
{
"key_code": "vk_none",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"simultaneous": [
{
"key_code": "i"
},
{
"key_code": "o"
},
{
"key_code": "p"
}
],
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "u",
"modifiers": [
"left_option"
]
},
{
"key_code": "u",
"modifiers": []
},
{
"key_code": "vk_none",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"simultaneous": [
{
"key_code": "j"
},
{
"key_code": "l"
}
],
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_or_backspace",
"modifiers": [
"left_option"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "d",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "9",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "f",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "0",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "u",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "open_bracket",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "p",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "close_bracket",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "open_bracket",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "o",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "close_bracket",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "x",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_forward",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "n",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_or_backspace",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "r",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "slash",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "t",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "backslash",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "e",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "quote",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "semicolon",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "7",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "quote",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "5",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "escape",
"modifiers": []
}
],
"type": "basic"
}
]
}
]
},
"fn_function_keys": [
{
"conditions": [],
"from": {
"key_code": "f1",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f2",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f3",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f4",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f5",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"consumer_key_code": "dictation"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f6",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f6",
"modifiers": []
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f7",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"consumer_key_code": "rewind"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f8",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f9",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"consumer_key_code": "fast_forward"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f10",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"consumer_key_code": "mute"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f11",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
],
"type": "basic"
},
{
"conditions": [],
"from": {
"key_code": "f12",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"consumer_key_code": "volume_increment"
}
],
"type": "basic"
}
],
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100,
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
},
"devices": []
}
]
}

View file

@ -0,0 +1,740 @@
{
"global": {
"ask_for_confirmation_before_quitting": true,
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "CAPSLOCK + hjkl to arrow keys (Post ESCAPE if press CAPSLOCK alone)",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "j",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "down_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "k",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "up_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "h",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "l",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "a",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "home"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "g",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "end"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "d",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "9",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "f",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "0",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "u",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "open_bracket",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "p",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "close_bracket",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "i",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "open_bracket"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "o",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "close_bracket"
}
],
"type": "basic"
},
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "escape"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "x",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "n",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "delete_or_backspace"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "r",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "slash"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "t",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "backslash"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "e",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "quote",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "semicolon",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "7",
"modifiers": [
"shift"
]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "quote",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "5",
"modifiers": [
"shift"
]
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 832,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 832,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 34304,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 50484,
"vendor_id": 1133
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 50484,
"vendor_id": 1133
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 8775,
"vendor_id": 1008
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"apple_vendor_keyboard_key_code": "mission_control"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"apple_vendor_keyboard_key_code": "spotlight"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"consumer_key_code": "dictation"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"key_code": "f6"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fast_forward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100,
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}

View file

@ -0,0 +1,181 @@
function manipulators(): Array<Mapping> {
return [
// movement
bindCaps("h", press("left_arrow")),
bindCaps("j", press("down_arrow")),
bindCaps("k", press("up_arrow")),
bindCaps("l", press("right_arrow")),
bindCaps("a", press("home")),
bindCaps("g", press("end")),
// umlauts
bind(["a", "s", "d"], umlaut("a")),
bind(["k", "l", "semicolon"], umlaut("o")),
bind(["i", "o", "p"], umlaut("u")),
bind(["s", "d", "f"], [press("s", ["left_option"]), press("vk_none")]),
bind(["j", "l"], press("delete_or_backspace", ["left_option"])),
bindCaps("d", press("9", ["shift"])),
bindCaps("f", press("0", ["shift"])),
bindCaps("u", press("open_bracket", ["shift"])),
bindCaps("p", press("close_bracket", ["shift"])),
bindCaps("i", press("open_bracket")),
bindCaps("o", press("close_bracket")),
bindCaps("x", press("delete_forward")),
bindCaps("n", press("delete_or_backspace")),
bindCaps("r", press("slash")),
bindCaps("t", press("backslash")),
bindCaps("e", press("quote", ["shift"])),
bindCaps("semicolon", press("7", ["shift"])),
bindCaps("quote", press("5", ["shift"])),
{
from: from("caps_lock"),
to: setVariable("caps_lock pressed", 1),
to_after_key_up: setVariable("caps_lock pressed", 0),
to_if_alone: [press("escape")],
type: "basic",
},
];
}
function fn_function_keys(): Array<Mapping> {
return [
bind("f1", toConsumer("display_brightness_decrement")),
bind("f2", toConsumer("display_brightness_increment")),
bind("f3", toApple("mission_control")),
bind("f4", toApple("spotlight")),
bind("f5", toConsumer("dictation")),
bind("f6", press("f6")),
bind("f7", toConsumer("rewind")),
bind("f8", toConsumer("play_or_pause")),
bind("f9", toConsumer("fast_forward")),
bind("f10", toConsumer("mute")),
bind("f11", toConsumer("volume_decrement")),
bind("f12", toConsumer("volume_increment")),
];
}
function generate() {
const rules = [{
description: "CAPSLOCK + hjkl to arrow keys",
manipulators: manipulators(),
}];
return {
global: {
ask_for_confirmation_before_quitting: true,
check_for_updates_on_startup: true,
show_in_menu_bar: true,
show_profile_name_in_menu_bar: false,
unsafe_ui: false,
},
profiles: [
{
complex_modifications: {
parameters: {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100,
},
rules,
},
fn_function_keys: fn_function_keys(),
indicate_sticky_modifier_keys_state: true,
mouse_key_xy_scale: 100,
name: "Default profile",
parameters: { delay_milliseconds_before_open_device: 1000 },
selected: true,
simple_modifications: [],
virtual_hid_keyboard: {
country_code: 0,
indicate_sticky_modifier_keys_state: true,
mouse_key_xy_scale: 100,
},
devices: [],
},
],
};
}
console.log(JSON.stringify(generate(), null, 2));
// Helpers and types
type Condition = { name: string; type: string; value: number };
type From =
| { key_code: string; modifiers: { optional: string[] } }
| { simultaneous: { key_code: string }[]; modifiers: { optional: string[] } };
type ToAction =
| { key_code: string; modifiers?: string[] }
| { consumer_key_code: string; modifiers?: string[] }
| { apple_vendor_keyboard_key_code: string; modifiers?: string[] }
| { set_variable: { name: string; value: number } };
type To = Array<ToAction>;
type Mapping = {
conditions?: Condition[];
from: From;
to: To;
to_after_key_up?: To;
to_if_alone?: To;
type: "basic";
};
function from(key: string | string[], optional: string[] = ["any"]): From {
if (typeof key === "string") {
return { key_code: key, modifiers: { optional } };
} else if (Array.isArray(key)) {
return {
simultaneous: key.map((x) => ({ key_code: x })),
modifiers: { optional },
};
} else {
throw new Error("Invalid key type");
}
}
function umlaut(letter: string): To {
return [
press("u", ["left_option"]),
press(letter),
press("vk_none"),
];
}
function press(key: string, mods: string[] = []): ToAction {
return { key_code: key, modifiers: mods };
}
function toConsumer(key: string): To {
return [{ consumer_key_code: key }];
}
function toApple(key: string): To {
return [{ apple_vendor_keyboard_key_code: key }];
}
function bind(
f: string | string[],
to: ToAction | To,
when: Condition[] = [],
): Mapping {
const toValue = Array.isArray(to) ? to : [to];
return { conditions: when, from: from(f), to: toValue, type: "basic" };
}
function bindCaps(from: string | string[], to: ToAction | To): Mapping {
const capsCondition: Condition = {
name: "caps_lock pressed",
type: "variable_if",
value: 1,
};
return bind(from, to, [capsCondition]);
}
function setVariable(name: string, value: number): To {
return [{ set_variable: { name, value } }];
}

View file

@ -0,0 +1,2 @@
#!/bin/sh
yq -o=json config.yaml > karabiner.json