-
-
Notifications
You must be signed in to change notification settings - Fork 829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set up a dead key? (or also, is it possible to pass the pressed any-key_code through?) #2477
Comments
What you are looking for is [1] https://karabiner-elements.pqrs.org/docs/json/complex-modifications-manipulator-definition/from/simultaneous/
Your modification manipulates all
send {
"type": "basic",
"from": { "key_code": "q" },
"to": [{ "set_variable": { "name": "dead-q", "value": 1 } }, {"key_code": "q"}],
"to_delayed_action": {
"to_if_invoked": [{ "set_variable": { "name": "dead-q", "value": 0 } }],
"to_if_canceled": [{ "set_variable": { "name": "dead-q", "value": 0 } }]
}
}
{
"type": "basic",
"from": { "key_code": "b" },
"to": [{"key_code": "delete_or_backspace"}, { "key_code": "c" }],
"conditions": [{ "type": "variable_if", "name": "dead-q", "value": 1 }]
} Note: 2nd is exact opposite of 3rd. In 2nd, Edit: 4th method: You can also use modifier keys in About
Currently, there is no way to "use" captured |
Why do you use 10 seconds for Btw, in 2nd method above, you will have to make a small change to your modification, so that when you press {
"type": "basic",
"from": { "key_code": "q" },
"to": [{ "set_variable": { "name": "dead-q", "value": 1 } }],
"to_delayed_action": {
"to_if_invoked": [{ "set_variable": { "name": "dead-q", "value": 0 } }, {"key_code": "q"}],
"to_if_canceled": [{ "set_variable": { "name": "dead-q", "value": 0 } }]
}
} |
@MuhammedZakir, thanks for your response. However, doesn't mean when using As for 3. JetBrains IDEs don't acknowledge that my dead key is not finished until I pressed a second key and thus already alter the source code on pressing the dead key (e.g. in Visual Mode) which is why I want to emulate that functionality for the IDEs to immediately emit only one key and circumvent the broken behaviour. Also, the 10 seconds are just for testing purposes. |
You're right. But, if you are okay with holding down, you can extend the time using P.S. You may also use variables to create a mode just for this and toggle it whenever you want dead keys. A simple mode without variables can be achieved using
Can you tell me what exactly you want to do? There might be another way to achieve what you want.
I see! |
Thanks again for the suggestions. Having to hold down the dead key for Adding every single key seems like an ugly and possibly fragile solution, but it should work. Maybe I should feature request a forward from PS: e.g.: I have > on a dead key, so if I want to indent a selection in IdeaVim's visual mode I can't reach > without pressing the dead key, this, however, gets registered as the dead key's combination with itself (means pressing the dead key twice) immediately. |
You're welcome! :-)
+1.
I am not sure if I understood it correctly, but have you tried remapping dead key and limit it to those specific apps? |
I'm trying to implement a dead key with Karabiner Elements' config.
My current attempt looks like this:
So far this works as intended: when I press [q, b] the output is just c. However, when pressing any other key than b, the output is just that other key.
So q is consumed either way, while a proper dead key wouldn't consume the key that acts as a dead key, when no combination was found.
So the expected output of e.g. [q, x] would be [q, x], when there is no combination for x.
I thought of something like this, using any-keycode, so I could implement the dead key's combinations with the snippet above and the rest is caught by any-key_code:
But there doesn't seem to be a way to obtain from's key_code or pass it through. So right now I can only always consume q or always prepend it, but not conditionally emit it when there's no combination.
Does anyone know of a method implementing a dead key using Karabiner Elements?
The text was updated successfully, but these errors were encountered: