1
0
mirror of https://github.com/danbee/dotfiles-local synced 2025-03-04 08:49:07 +00:00

Update Karabiner config

This commit is contained in:
Daniel Barber 2019-04-18 14:38:58 -04:00
parent abce1805eb
commit 2291abd47c
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
4 changed files with 846 additions and 1 deletions

View File

@ -0,0 +1,507 @@
{
"title": "Map fn + number keys to function keys (rev 2)",
"rules": [
{
"description": "Map fn + number keys to their corresponding function keys (rev 1)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "1",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f1",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "2",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f2",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "3",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f3",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "4",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f4",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "5",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f5",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "6",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f6",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "7",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f7",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "8",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f8",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "9",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f9",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "0",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f10",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "hyphen",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f11",
"modifiers": [
"fn"
]
}
]
},
{
"type": "basic",
"from": {
"key_code": "equal_sign",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f12",
"modifiers": [
"fn"
]
}
]
}
]
},
{
"description": "Map fn + number keys to their corresponding media control keys (rev 2)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "1",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f1"
}
]
},
{
"type": "basic",
"from": {
"key_code": "2",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f2"
}
]
},
{
"type": "basic",
"from": {
"key_code": "3",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f3"
}
]
},
{
"type": "basic",
"from": {
"key_code": "4",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f4"
}
]
},
{
"type": "basic",
"from": {
"key_code": "5",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f5"
}
]
},
{
"type": "basic",
"from": {
"key_code": "6",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f6"
}
]
},
{
"type": "basic",
"from": {
"key_code": "7",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f7"
}
]
},
{
"type": "basic",
"from": {
"key_code": "8",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f8"
}
]
},
{
"type": "basic",
"from": {
"key_code": "9",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f9"
}
]
},
{
"type": "basic",
"from": {
"key_code": "0",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f10"
}
]
},
{
"type": "basic",
"from": {
"key_code": "hyphen",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f11"
}
]
},
{
"type": "basic",
"from": {
"key_code": "equal_sign",
"modifiers": {
"mandatory": [
"fn"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "f12"
}
]
}
]
}
]
}

View File

@ -0,0 +1,191 @@
{
"title": "Prevent unintended command-q (rev 2)",
"rules": [
{
"description": "Quit application by pressing command-q twice",
"manipulators": [
{
"type": "basic",
"conditions": [
{
"type": "variable_if",
"name": "command-q",
"value": 1
}
],
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "q",
"modifiers": "left_command"
}
]
},
{
"type": "basic",
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"set_variable": {
"name": "command-q",
"value": 1
}
}
],
"to_delayed_action": {
"to_if_invoked": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
],
"to_if_canceled": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
]
}
}
]
},
{
"description": "Quit application by holding command-q",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to_if_held_down": [
{
"key_code": "q",
"modifiers": [
"left_command"
],
"repeat": false
}
]
}
]
},
{
"description": "Quit Safari by pressing command-q twice",
"manipulators": [
{
"type": "basic",
"conditions": [
{
"type": "variable_if",
"name": "command-q",
"value": 1
},
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Safari$"
]
}
],
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"key_code": "q",
"modifiers": "left_command"
}
]
},
{
"type": "basic",
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"^com\\.apple\\.Safari$"
]
}
],
"from": {
"key_code": "q",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"caps_lock"
]
}
},
"to": [
{
"set_variable": {
"name": "command-q",
"value": 1
}
}
],
"to_delayed_action": {
"to_if_invoked": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
],
"to_if_canceled": [
{
"set_variable": {
"name": "command-q",
"value": 0
}
}
]
}
}
]
}
]
}

View File

@ -0,0 +1,68 @@
{
"title": "device_if,device_unless example",
"rules": [
{
"description": "Open Karabiner-Elements by f5 in non-Apple keyboards",
"manipulators": [
{
"conditions": [
{
"type": "device_unless",
"identifiers": [
{
"vendor_id": 1452
}
]
}
],
"type": "basic",
"from": {
"key_code": "f5",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"shell_command": "open -a 'Karabiner-Elements.app'"
}
]
}
]
},
{
"description": "Open Karabiner-EventViewer by f6 in HHKB BT JP keyboards",
"manipulators": [
{
"conditions": [
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1278,
"product_id": 515
}
]
}
],
"type": "basic",
"from": {
"key_code": "f6",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"shell_command": "open -a 'Karabiner-EventViewer.app'"
}
]
}
]
}
]
}

View File

@ -676,6 +676,85 @@
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": []
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 591,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": {
"key_code": "left_control"
}
}
]
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 598,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": {
"key_code": "left_control"
}
}
]
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 615,
"vendor_id": 76
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": {
"key_code": "left_control"
}
}
]
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 45081,
"vendor_id": 1133
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": []
}
],
"fn_function_keys": [
@ -786,4 +865,4 @@
}
}
]
}
}