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

Multiple key strokes as one #16

Closed
wxmtech opened this Issue Sep 16, 2016 · 157 comments

Comments

Projects
None yet
@wxmtech

wxmtech commented Sep 16, 2016

Anyway that we could use karabiner-elements to simulate a combo of "cmd+opt+ctrl" using "Caps Lock"?

@jonohunt

This comment has been minimized.

jonohunt commented Sep 16, 2016

Yeah, I'd like something similar.

I want to remap the Caps Lock to 'Shift-Command-Option-Control' to get my 'Hyper Key' back.

@welladamm

This comment has been minimized.

welladamm commented Sep 16, 2016

@jonohunt I definitely second this one. I'm sooooo missing my Hyper key on 10.11.

@MartinAyla

This comment has been minimized.

MartinAyla commented Sep 16, 2016

Looking forward to Hyper key support again :)

@niieani

This comment has been minimized.

niieani commented Sep 19, 2016

Yeah. I miss Forward Delete key from simultaneous + & backspace ;)
What do you use the Hyper Key for?

@talha131

This comment has been minimized.

Contributor

talha131 commented Sep 19, 2016

@niieani I use hyper key with HammerSpoon.

My Capslock is mapped to ctrl.
Ctrl is mapped to hyper key.

I press Hyper key with different combinations to launch Hammerspoon actions.

Say Hyper+s to put system to sleep.
Hyper+a+<key> to launch applications. (<key> from this list)

@prohtex

This comment has been minimized.

prohtex commented Sep 21, 2016

I just donated to this very worthy project. It seems Karabiner-Elements is, for the moment, limited to swapping two keys, whereas the syntax from the old Karabiner would allow for much more complex substitutions. Here's to hoping this functionality will be restored post haste, in any form.

@aetherwu

This comment has been minimized.

aetherwu commented Sep 21, 2016

Anyone can contribute a simple version of 'Hyper Key'? This is the only function that I need...to active my Alfred basically.

@wxmtech

This comment has been minimized.

wxmtech commented Sep 21, 2016

Based on karabiner-elements, there’s no examples on hyper key functions. Just simple key swapping which is the same as what macOS provides.

On Sep 21, 2016, at 16:59, Aether notifications@github.com wrote:

Anyone can contribute a simple version of 'Hyper Key'? This is the only function that I need...to active my Alfred basically.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #16 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ADKNgkHn7GAVQquPU_zP3cqCYRf1R38sks5qsPHugaJpZM4J-nDt.

@seaneking

This comment has been minimized.

seaneking commented Sep 21, 2016

Big +1 for this, main reason I used Seil/Karabiner was to remap capslock -> cmd+space to trigger Alfred

@larpo

This comment has been minimized.

larpo commented Sep 21, 2016

I hope this gets implemented soon. I used several custom fn+cmd+ mappings and my muscle memory is driving me crazy after updating one of my machines to sierra...

@matthewdias

This comment has been minimized.

matthewdias commented Sep 21, 2016

As a workaround I am using karabiner-elements to map caps to right control, since all of my hyper binds are setup in https://github.com/koekeishiya/kwm . Right control support hasn't been added yet, so you can use a different modifier that you don't use, or use my fork https://github.com/matthewdias/kwm/tree/rightcontrol?files=1 for right or left control.

@matthewdias

This comment has been minimized.

matthewdias commented Sep 21, 2016

Also: keep an eye on https://github.com/koekeishiya/khd as binds are being moved out into that repo.

@prohtex

This comment has been minimized.

prohtex commented Sep 21, 2016

Has anyone rooted around in the source to see if there's more advanced syntax that's just not included in the examples? I really don't want to buy something like "Keyboard Maestro" but I'm really stuck!

@TSFoster

This comment has been minimized.

TSFoster commented Sep 21, 2016

@prohtex Yes, I had a look last week and there wasn't. I think Keyboard Maestro has quite a generous trial period, and changes are being made to Karabiner Elements very quickly, so perhaps you won't need to buy a license for Keyboard Maestro before Karabiner Elements has the functionality you need.

@prohtex

This comment has been minimized.

prohtex commented Sep 21, 2016

Well, after a good deal of work, neither Keyboard Maestro nor Hammerspoon seem to work from the lock screen (not the login screen, the lock screen that appears after the screensaver is triggered) and so are not useful for my application. I guess karabiner-elements is the only hope.

@natemcintyre

This comment has been minimized.

natemcintyre commented Sep 22, 2016

Would definitely love to vote for this. Losing access to my Hyper key due to Seil+Karabiner not working with macOS Sierra has definitely been the sour part of my day. At the same point, thank you very much for your efforts to work on this for the community. Wish Apple would just give us access to a key mapper in the OS by default.

@warthurton

This comment has been minimized.

warthurton commented Sep 22, 2016

I have created a Keyboard Maestro Macro Library that approximates the Hyper Key if based off F19 remap.

{
    "profiles": [
        {
            "name": "Default profile",
            "selected": true,
            "simple_modifications": {
                "caps_lock": "left_control",
                "left_control": "f19"
            }
        }
    ]
} 

There are a couple of things though

  • You have to release Left Control (F19) or whatever you mapped between each keystroke
  • There is a mode notification that Keyboard Maestro displays
  • Not every key has been created. Currently:

A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, Grave, Minus, Equal, LeftBracket, RightBracket, Semicolon, Quote, Comma, Period, Slash, Backslash, Space, Return, Tab, Delete, ForwardDelete, Linefeed ?, Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, LeftArrow, RightArrow, DownArrow, UpArrow

Key Code Reference

F19 Macros.zip

I'd love any comments or enhancements. I hope this helps some of you.

@birarda

This comment has been minimized.

birarda commented Sep 22, 2016

@warthurton though it's annoying to have to release between each keystroke, this is at least getting me SOME sanity back with Slate.

Thank you!

@prenagha

This comment has been minimized.

prenagha commented Jun 14, 2017

Fixed. I think I had hyper stepping on the VI commands. Here is my complete config with vi movement and hyper keys which so far is working great. Thanks again.

https://gist.github.com/prenagha/3b1a0b18f09c1df91d7c2a376f27a4eb

@sinewave

This comment has been minimized.

sinewave commented Jun 15, 2017

Wow, this is great news!!

Has anyone figured out if/how it’s possible to replicate the home row functionality from Karabiner? ie. Holding down the space bar allows you to change what most home row and other keys do.

That’s the one I’ve been waiting for before upgrading to Sierra

@arjunlall

This comment has been minimized.

arjunlall commented Jun 15, 2017

@sinewave This is what you need, just change it to whatever modifier you want to use instead of left shift. https://github.com/tekezo/Karabiner-Elements/blob/70fcaa177d4d0b409e77c6166505a34780316848/examples/spacebar_to_shift.json

@sinewave

This comment has been minimized.

sinewave commented Jun 15, 2017

@brunorsini

This comment has been minimized.

brunorsini commented Jun 16, 2017

@tphalp

This comment has been minimized.

tphalp commented Jun 19, 2017

@brunorsini This config works for me for mapping Caps-lock to ctrl-alt-command.

I'm on version 0.91.4.

"complex_modifications": {
    "rules": [
        {
            "manipulators": [
                {
                    "description": "Change caps_lock to command+control+option.",
                    "from": {
                        "key_code": "caps_lock",
                        "modifiers": {
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "left_command",
                            "modifiers": [
                                "left_control",
                                "left_option"
                            ]
                        }
                    ],
                    "type": "basic"
                }
            ]
        }
    ]
}
@ttscoff

This comment has been minimized.

@eyemyth

This comment has been minimized.

eyemyth commented Jun 27, 2017

Is it possible to use standard keys as modifier keys for complex configurations? I'm trying to get vi emulation using s+hjkl like in the old Karabiner. I tried this:

      "complex_modifications": {
          "rules": [
              {
                  "manipulators": [
                      {
                          "description": "Vi s+h to arrow key left",
                          "from": {
                              "key_code": "h",
                              "modifiers": {
                                  "mandatory": ["s"]
                              }
                          },
                          "to": [
                              {"key_code": "left_arrow"}
                          ],
                          "type": "basic"
                      }
                  ]
              }
          ]
      },

But that just mapped the h to left arrow, no matter if the s key was held down or not.

@briansoule

This comment has been minimized.

briansoule commented Jun 27, 2017

@eyemyth

This comment has been minimized.

eyemyth commented Jul 1, 2017

The latest update add exactly what I described above. I'm super happy!

@0x3333

This comment has been minimized.

0x3333 commented Jul 3, 2017

Is double key press supported? Like: CMD+CMD = Ctrl+Shift+A ?

@timbitzen

This comment has been minimized.

timbitzen commented Jul 3, 2017

Is there any way to modify space bar to be CMD when combined with other keys, but insert space otherwise? I have RSI and the modification would help me.

I tried using the built-in modification for "Change Spacebar to left_shift" and then modifying the
.json by subsitutting left_shift for left_command, as follows:

"profiles": [
        {
            "complex_modifications": {
                "parameters": {
                    "basic.to_if_alone_timeout_milliseconds": 1000
                },
                "rules": [
                    {
                        "description": "Change spacebar to left_shift. (Post spacebar if pressed alone)",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "spacebar",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_command"
                                    }
                                ],
                                "to_if_alone": [
                                    {
                                        "key_code": "spacebar"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {

However, that didn't work. When I press spacebar + A on this page, for example, it scrolls instead of select all.

Any ideas?

@arjunlall

This comment has been minimized.

arjunlall commented Jul 3, 2017

I have a similar rule, the only difference seems to be that in the to if alone clause I have some details on the modifier there as well. this works well for me. Also, double check you have the latest beta version installed.

{

                            "description": "Change right_command to delete when on own, otherwise map to fn",
                            "from": {
                                "key_code": "right_command",
                                "modifiers": {
                                    "optional": [
                                        "any"
                                    ]
                                }
                            },
                            "to": [
                                {
                                    "key_code": "fn"
                                }
                            ],
                            "to_if_alone": [
                                {
                                    "key_code": "delete_or_backspace",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                }
                            ],
                            "type": "basic"
                        }
@DJF3

This comment has been minimized.

DJF3 commented Jul 11, 2017

Hurray!! Finally I'm able to convert my CapsLock to double-quotes again!

                    "manipulators": [
                        {
                            "description": "Change caps_lock to double-quotes.",
                            "from": {
                                "key_code": "caps_lock",
                                "modifiers": {
                                    "optional": [
                                        "any"
                                    ]
                                }
                            },
                            "to": [
                                {
                                    "key_code": "quote",
                                    "modifiers": [
                                        "left_shift"
                                    ]
                                }
                            ],
                            "type": "basic"
                        }
                    ]
@timbitzen

This comment has been minimized.

timbitzen commented Aug 28, 2017

Just wanted to post a hint for anyone in the future who runs into the issue I had with caps_lock as Hyper key.

Situation:
Attemtping to have Caps Lock act as Hyper key when used with another key, and act normally as Caps toggle otherwise.

Issue:
Using Brett Terpstra's instructions, I wasn't able to have Caps function as normal when not used with a modifier key. That is, modifying the "to_if_alone" value in the JSON to "caps_lock" did not preserve the toggle.

Solution:
Karabiner Elements settings -> Virtual Keyboard -> Caps Lock Delay to 0 ms.

I also disabled caps lock in System Preferences per Brett's instructions, but that did not have any effect.

@pgilfernandez

This comment has been minimized.

pgilfernandez commented Oct 19, 2017

Please, help here: I'm trying to use the "one to many mapping" to bind button3 to spacebar+button1 but cannot understand how to use it...
My last try was:

                            {
                                "conditions": [
                                    {
                                        "bundle_identifiers": [
                                            "com\\.adobe\\.illustrator"
                                        ],
                                        "type": "frontmost_application_if"
                                    }
                                ],
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "pointing_button": "button3"
                                },
                                "to": [
                                    {
                                        "key_code": "spacebar",
                                        "pointing_button": "button1"
                                    }
                                ],
                                "type": "basic"
                            }

Could anyone help?

Thanks!

@jenjwong

This comment has been minimized.

jenjwong commented Dec 18, 2017

Anyone know if "Multiple key strokes as one" feature got added and where I might find an example of the config? Thanks!

@christopherdwhite

This comment has been minimized.

christopherdwhite commented Dec 20, 2017

@jenjwong It is added and I believe it ships with an example in Complex Modifications > Add rule, you can find more through the Import more rules... button.

@Shnez

This comment has been minimized.

Shnez commented Dec 20, 2017

Does anyone know how I could make left control + left click = left click? This used to be an option in karabiner, but it's not in KE and I really need it. If you know how to add this somehow, please let me know how

@mskonovalov

This comment has been minimized.

mskonovalov commented Dec 27, 2017

@Shnez unfortunately here is no such option afaik because in MacOS it leads to left_button system wide.
I've to swap Ctrl and Cmd and then tune my Intellij Idea hot keys

@krasnovpro

This comment has been minimized.

krasnovpro commented Jan 18, 2018

Can I map "button3 -> space+button1"?

@pgilfernandez

This comment has been minimized.

pgilfernandez commented Jan 18, 2018

@Palisand

This comment has been minimized.

Palisand commented Jan 18, 2018

Don't know if this will come in handy, but I could not find a mention of the fact that you can use multiple key_codes:

{
                "description": "'b' -> 'bar'",
                "from": {
                  "key_code": "b"
                },
                "to": [
                  {
                    "key_code": "b"
                  },
                  {
                    "key_code": "a"
                  },
                  {
                    "key_code": "r"
                  }
                ],
                "type": "basic"
}

This is useful for performing basic actions in succession.

@wxmtech

This comment has been minimized.

wxmtech commented Jan 21, 2018

@prohtex

This comment has been minimized.

prohtex commented Mar 11, 2018

Is double key press supported? Like: CMD+CMD = Ctrl+Shift+A ?

@0x3333 Also wondering about this. Did you get it to work?

@0x3333

This comment has been minimized.

0x3333 commented Mar 12, 2018

@prohtex I didn't . In the end I changed my workflow. But still interested.

@tekezo

This comment has been minimized.

Owner

tekezo commented Mar 12, 2018

@tekezo tekezo closed this Mar 12, 2018

@quiffboy

This comment has been minimized.

quiffboy commented Oct 8, 2018

Did the one_to_many_mappings feature from @wwwjfy ever get added back into the main codebase? I was using it on an old build but have just got a new Mac (running High Sierra) and need to recreate this:

"one_to_many_mappings": { "non_us_backslash": [ "left_option", "3" ] }

If it wasn't added, is there a comparable feature in the latest build to map left_option+3 to the § key?

EDIT: apologies, just spotted this issue was closed on 12 March :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment