Skip to content

Instantly share code, notes, and snippets.

@ndbroadbent
Last active September 8, 2022 23:19
Show Gist options
  • Save ndbroadbent/c4d7906d8c9be59ccd0b69e0e34ecf61 to your computer and use it in GitHub Desktop.
Save ndbroadbent/c4d7906d8c9be59ccd0b69e0e34ecf61 to your computer and use it in GitHub Desktop.
Karabiner-Elements rule - Double press keypad_enter to press Fn twice and start dictation
{
"title": "Double tap keypad_enter to double tap fn (start dictation.) Single tap for keypad_enter after a short delay (250ms.)",
"rules": [
{
"description": "This rule solves a problem with the Microsoft Surface Ergonomic Keyboard. The `Fn` key can't be used to start dictation, since it only toggles an internal state on and off, and it does not actually send any keypress event. This rule allows you to start dictation by double tapping the keypad enter key, which will send Fn twice. If you only press the keypad enter key once, it will send the original enter key after a short delay (250ms).",
"manipulators": [
{
"conditions": [
{
"name": "keypad_enter pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "keypad_enter",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "fn"
}
],
"type": "basic"
},
{
"from": {
"key_code": "keypad_enter",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "keypad_enter pressed",
"value": 1
}
},
{
"key_code": "fn"
}
],
"parameters": {
"basic.to_delayed_action_delay_milliseconds": 250
},
"to_delayed_action": {
"to_if_canceled": [
{
"set_variable": {
"name": "keypad_enter pressed",
"value": 0
}
}
],
"to_if_invoked": [
{
"set_variable": {
"name": "keypad_enter pressed",
"value": 0
}
},
{
"key_code": "keypad_enter"
}
]
},
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment