I lastly discovered a good resolution with Karabiner-Components. I simply discovered that it helps complicated guidelines with variables, situations, and delays, so I used to be capable of customise the habits of the Enter key on my keypad. I arrange a rule that can begin dictation if I press it twice, however I can nonetheless use the Enter key if I solely press it as soon as (with a brief delay.)
Right here is my JSON rule:
{
"title": "Double faucet keypad_enter to double faucet fn (begin dictation.) Single faucet for keypad_enter after a brief delay (250ms.)",
"guidelines": [
{
"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": {
"non-obligatory": [
"any"
]
}
},
"to": [
{
"key_code": "fn"
}
],
"sort": "fundamental"
},
{
"from": {
"key_code": "keypad_enter",
"modifiers": {
"non-obligatory": [
"any"
]
}
},
"to": [
{
"set_variable": {
"name": "keypad_enter pressed",
"value": 1
}
},
{
"key_code": "fn"
}
],
"parameters": {
"fundamental.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"
}
]
},
"sort": "fundamental"
}
]
}
]
}
I’ve additionally submitted a PR so as to add this instance to their documentation.
If this PR is merged then it is possible for you to to go to https://ke-complex-modifications.pqrs.org and click on the blue “Import” button to import the JSON into your Karabiner-Components app.
Within the meantime, right here is how one can manually import the rule.
Open a brand new file in your textual content editor, and paste the JSON above. Save the file to your property listing: ~/double_tap_keypad_enter_to_double_tap_fn.json
Open a terminal and run these instructions:
mkdir -p ~/.config/karabiner/property/complex_modifications/
mv ~/double_tap_keypad_enter_to_double_tap_fn.json ~/.config/karabiner/property/complex_modifications/
(The ~/.config
listing is often hidden from Finder and the “Save File” window, so it is simpler to make use of the terminal for this step.)
Go to the Complicated Modifications web page and click on Add Rule. (You needn’t restart Karabiner-Components if it is already operating, it ought to discover the brand new JSON file instantly.)
It’s best to see the brand new rule. Click on “Allow”.
Lastly, be sure your keyboard settings are appropriate. (In case you’ve got been making an attempt a couple of different issues earlier than discovering this resolution.)
Open the System Preferences and click on “Keyboard”.
Be certain that the dictation shortcut is configured accurately: “Press 🌐 to Begin Dictation (Press 🌐 twice)”
Facet word: The Microsoft Floor Ergonomic Keyboard does not even have a 🌐 Globe key, however that is simply the Fn key with a unique title and icon.
Now click on “Modifier Keys”:
It’s best to see the digital Karabiner keyboard driver, and the Globe (🌐) key ought to be set to 🌐 Globe.
The rule is now lively, so open your textual content editor and check out it out. Whenever you press the keypad enter key as soon as, it is best to see a brand new line after a brief delay. Whenever you press it twice, it ought to begin dictation.
Please be at liberty to switch this rule and select your personal key, or change all the logic. I hope this instance may help you get began with your personal customizations. Ensure you take a look at a number of the different examples within the documentation, and skim the “complicated modification” documentation to see all of the issues you are able to do with Karabiner-Components.
Get pleasure from!