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
Standalone keys + One-to-many mappings #247
Conversation
fb1ca4a
to
6a742a3
Compare
This works absolutely perfectly! I absolutely need this functionality as I remap Caps Lock to Escape (on single press) and Left Control (when held down) so I never have to leave the home row when using vim. I hadn't realised quite how ingrained this was until it broke and I couldn't work any more! Thought I would leave a comment, not only to say thanks but also to make this potentially a bit easier to google. |
7f15552 seems to have broken the functionality for me :( Using the configuration above with this build will change caps lock to control, but not include the escape key at the end: |
@garymh It works for me. Please try to recompile and reinstall (a easier way is to run 7f15552 should not break this, as this commit changes the key with modifier or not, and should not affect when used alone. |
@wwwjfy Yep, totally right! Thanks and sorry for the confusion! |
@wwwjfy Your fix is nice; but when I type |
@zhexuany That'd be ideal (Karabiner should be doing that, I can't remember clearly). Current hack is using the simpler way, that |
542a5f0
to
a2fb886
Compare
JFYI, I rebased the code on latest master (0.90.47) |
@kibin clone the repo, and it's in root path of the repo. |
@wwwjfy I’ve uninstalled, reinstalled (esc started working), then updated and it stopped working again. Guess I’ll try to clone repo |
@wwwjfy It worked on your last release but not work in your latest code. Maybe there are something you overlooked. |
@kibin I see. You have to build it yourself (or someone build it for every new release), because this is a PR, not in mainstream, and when you updated, the hack is gone. |
@zhexuany I'm not sure about your case now. I've changed something to suit other cases. |
@wwwjfy I just download your release from your repo. It works just fine. But the copy I compiled myself from your code under |
@zhexuany By I did various fixes and rebase in last week, could you try the latest commit? (committed a few hours ago) |
@wwwjfy That may be the issue. I just pulled from you repo. A lots conflicts. |
It's expected because I did rebase. Just |
@wwwjfy Now everything works just fine. Thanks for you patience. |
a2fb886
to
fcfb3a1
Compare
Looking forward to this! It's one of the main features I used in Karabiner. |
@zhexuany Thanks, but I don't think the hack should be in merged. It's just to be convenient for Sierra users before the official feature implemented. And I created the pull request to be simpler to apply for any one who needs it, not to be merged. :) |
@wwwjfy This works really well for me, thanks! However, this seems to break the |
@hndrewaall It's related to #89, not this patch. Event Viewer uses system event to show the pressed keys, so it doesn't mean Karabiner-Elements can handle it currently. |
@bosr I'm running this PR in High Sierra beta 1 and all appears ok so far. I'm just doing a basic "Caps to HYPER while holding and tapping Caps pressing ESC" modification, but that's still working fine for me. |
@kennonb thanks! |
Happy to report the newest version (0.91.3) now supports
|
Is there a way to preserve the fn while it being mapped to hyper? |
Answering myself, certainly not the most elegant way by any means, but managed to do it with hammerspoon: local hyper_fn_keys = {
{'f1', 'BRIGHTNESS_DOWN'},
{'f2', 'BRIGHTNESS_UP'},
{'f5', 'ILLUMINATION_DOWN'},
{'f6', 'ILLUMINATION_UP'},
{'f7', 'PREVIOUS'},
{'f8', 'PLAY'},
{'f9', 'NEXT'},
{'f10', 'MUTE'},
{'f11', 'SOUND_DOWN'},
{'f12', 'SOUND_UP'}
}
for i, keymap in ipairs(hyper_fn_keys) do
hs.hotkey.bind(hyper, keymap[1], function()
hs.eventtap.event.newSystemKeyEvent(keymap[2], true):post()
hs.eventtap.event.newSystemKeyEvent(keymap[2], false):post()
end)
end I can't get mission control or launch panel to work but given they've gestures I'm not too concerned. |
@tomislav For anyone else who wants to make Caps Lock into Hyper (ctrl, opt, cmd, shift) make this your ~/karabiner/karabiner.json (also update to the beta version under the misc menu in Karabiner)
|
@jahamed mostly by reading the commits. Also check out the examples folder. There is also a timeout option for to_if_alone. |
Finally, 0.91.x has complex_modifications and I've successfully migrated from this fork. The from/to/to_if_alone keys allow you to set up any-to-any mappings and standalone key bindings. @wwwjfy You really saved my life, thank you for everything you've done! |
what is this complex modification thing ? what can i do with it ? |
@jhegedus42 A lot. Here's an example: You can even choose both mandatory and optional modifier keys for the key combination you're remapping - So you could have shift+caps_lock remap to something. Check out these examples: |
For those wondering, here is how you get Ctrl to emit Esc when pressed alone in Karabiner Elements 0.91.4: "complex_modifications": {
"rules": [
{
"manipulators": [
{
"description": "Change ctrl to esc if pressed alone.",
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control"
}
],
"to_if_alone": [
{
"key_code": "escape"
}
],
"type": "basic"
}
]
}
]
} |
If you're a modern space cadet, try this configuration: {
"profiles": [
{
"name": "Default profile",
"selected": true,
"complex_modifications": {
"rules": [
{
"description": "A Modern Space Cadet (Steve Losh)",
"manipulators": [
{
"type": "basic",
"from": {"key_code": "caps_lock"},
"to": [{"key_code": "left_control"}],
"to_if_alone": [{"key_code": "escape"}]
},
{
"type": "basic",
"from": {"key_code": "left_shift"},
"to": [{"key_code": "left_shift"}],
"to_if_alone": [{"key_code": "9", "modifiers": ["left_shift"]}]
},
{
"type": "basic",
"from": {"key_code": "right_shift"},
"to": [{"key_code": "right_shift"}],
"to_if_alone": [{"key_code": "0", "modifiers": ["right_shift"]}]
}
]
}
]
}
}
]
} It feels so good to have shift-parens back! 🎉 |
Here's an example of Space/FN + IJKL arrow keys...
Pull request here: #794 |
Is |
@aaronjensen No, you can change |
Sorry, I should have been more clear. In karabiner you could create custom modifiers. Fn is not actually custom, it is built in. Furthermore, I believe it is flagged along with every key press if you have the use f keys as f keys checked, making it not useful in those instances. If I were to use fn as an additional modifier, to say, make my home row produce brackets, I could not then also use f keys as f keys afaict. That said, these additions are huge as they are and I'm looking forward to what comes next. If there is a way to have custom modifiers that I don't know of then great, otherwise I'll probably open a new issue if there isn't one already. |
Seems I was mistaken on this, I don't remember when I saw that... |
This is a memo for anyone who had problems with I could not make the following with
With |
Thank you for the fork! |
Using the following version of Karabiner: pqrs-org/Karabiner-Elements#247
I need to map "button3 -> space+button1". How can I do this? |
@dtothefp it's not merged and wasn't meant to be 😅 |
This is to implement Karabiner's
Control_L to Control_L (+when you type Control_L only, send Escape)
functionality. It's a temp solution, which can be used until the official one comes out.Updated (2017.01.06): Added one-to-many mappings, to get one key behaves like multiple keys.
Download the customized build at https://github.com/wwwjfy/Karabiner-Elements/releases
Usage: