Closed kbdluv closed 6 years ago
Same boat as I want to map some modifier to the homerow. Rollover is a big issue and makes it not usable at the moment. :(
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@jonathankau @kbdluv @rubas I think I came up with a working solution (on Karabiner-Elements v12.2.0) to prevent accidental modifier hits via a delay:
{
"description": "spacebar -> left_command (spacebar if pressed alone)",
"manipulators": [
{
"from": {
"key_code": "spacebar",
"modifiers": {
"optional": ["any"]
}
},
"parameters": {
"basic.to_delayed_action_delay_milliseconds": 200,
"basic.to_if_held_down_threshold_milliseconds": 200
},
"to_delayed_action": {
"to_if_canceled": [
{
"key_code": "spacebar"
}
]
},
"to_if_alone": [
{
"key_code": "spacebar",
"halt": true
}
],
"to_if_held_down": [
{
"key_code": "left_command"
}
],
"type": "basic"
}
]
}
Big props, @elasticdog! That code works a treat. 💯
@elasticdog Thanks for sharing that with the community - been trying to make this happen without success for a while until I found your snippet.
@elasticdog, sorry for reviving an old thread, but I've been trying to get this to work for a long time without any luck until I found your post! 🎉🎉
Do you know how I can use this approach to support multiple keys? For example, using your code above, I've mapped "j" to Cmd and "k" to Shift. I'd like to be able press and hold both to trigger "Cmd + Shift."
Opening an issue for this comment here as I face the same problem:
One proposed solution to this issue is #877, which solves the case for when the held spacebar is released after the key that is pressed with it, and I'm sure the feature has additional good uses.
I'm opening this as a separate issue because the overlap/rollover threshold would also solve the case for when the held spacebar is released before the key that is pressed with it. The order of the keydowns in that case would not be relevant.