Is there a way to map parenthesis with the left and right keys? and when I use shift + letter it acts like a normal shift?
Just like the old functionality in Karabiner before macOS Sierra…I'm looking for this too…I use this ALL the time! 😢
For what I can see here https://github.com/tekezo/Karabiner-Elements/issues/369
this functionality is going to be part of the advanced/complex modifications feature.
I am not a super-user, but I miss nothing more than this.
Right now, I have left_shift -> 9 and right_shift unchanged, so right_shift + left_shift -> <left_parenthesis>. Editors that support auto-complete usually help in adding the right-parenthesis.
Suggestion: How about providing an option to remap a <KEY> -> <left_parenthesis> without needing shift.
Bonus: shift + <KEY> -> <right_parenthesis>
Is it possible to do this already?
You can do this with another app as mentioned in #437. Gives an interim solution that works pretty well until it's added here
@willmcclellan it works alright, but the problem I have is that the old Karabiner used to type ( on key up. The other app types on key down, which causes a huge issue for typing capital letters…
@daviesgeek I have a PR that is a fork of #247 that hardcodes parens the way you want (warning: it's hardcoded right in the C++ because I'm lazy and impatient): see https://github.com/wwwjfy/Karabiner-Elements/pull/1
@jasonmay Oh sweet thanks! I'll have to try it out!!
Been missing that as well, here's how I did it with the latest complex modifications feature:
https://github.com/martinklepsch/dotfiles/commit/83e4989d7ea3afb2809e74b34e77d8111136b5d8
It works! The basic how-to, so you can save some time:
Go to ~/.config/karabiner/karabiner.json -- If this file doesn't exist, go to Karabiner-Elements and in Preferences > Complex Modifications add a Modification from the examples. The karabiner.json file will be auto-generated in the folder mentioned above.
Grab martinklepsch's example code shown below and paste it in.
Make sure you've a manipulators object inside "rules": [ ... ].
Feel the power and comfort of shift-parens. 🤘
Look for:
{
"profiles": [{
"complex modifications": {
"rules": [
and that's where you'll add:
{
"manipulators": [{
"description": "map left shift to opening parenthesis",
"type": "basic",
"from": {
"key_code": "left_shift",
"modifiers": {
"optional": ["any"]
}
},
"to_if_alone": [{
"key_code": "9",
"modifiers": ["left_shift"]
}],
"to": [{
"key_code": "left_shift",
"modifiers": []
}]
},
{
"description": "map right shift to closing parenthesis",
"type": "basic",
"from": {
"key_code": "right_shift",
"modifiers": {
"optional": ["any"]
}
},
"to_if_alone": [{
"key_code": "0",
"modifiers": ["right_shift"]
}],
"to": [{
"key_code": "right_shift",
"modifiers": []
}]
},
}]
}
For easy importing use this URL:
Here's the gist if you want to see/fork: https://gist.github.com/eyemyth/db4f923bcbd640b2d71a5f3fa0670e3a
Anyone else having problems with the above configuration after a recent update? I'm getting two opening parenthesis when hitting left shift and two closing ones when hitting right shift.
Hm, I got it back to work (i.e. one shift per keypress) by entirely deleting the modification rule, restarted Karabiner-Elements after deleting the rule as well. 🤔
@eyemyth @malloryerik Thank you SO MUCH! I relied on Karabiner so much for this and have missed it ever since Karabiner Elements came out.
I think there is still a problem with this version noted in the URL on 7 Aug. Compared to the version I used in El Capitan, holding left-shift whilst pressing right-shift would emit "()", whereas now on High Sierra it emits just the ")". This is rather frustrating because if you type too fast you will fail to emit the parentheses pair correctly. Does anyone know how one might be able to implement this feature?
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.
Most helpful comment
For easy importing use this URL:
karabiner://karabiner/assets/complex_modifications/import?url=https%3A%2F%2Fgist.githubusercontent.com%2Feyemyth%2Fdb4f923bcbd640b2d71a5f3fa0670e3a%2Fraw%2Fe62566f8db8985c07eb33df9459f247561218614%2Fshift_to_parentheses.json
Here's the gist if you want to see/fork: https://gist.github.com/eyemyth/db4f923bcbd640b2d71a5f3fa0670e3a