ianyh / Amethyst

Automatic tiling window manager for macOS à la xmonad.
https://ianyh.com/amethyst/
MIT License
14.87k stars 487 forks source link

Modal modifier keys #188

Closed cro closed 7 years ago

cro commented 10 years ago

Greetings,

I use KeyRemap4Macbook (now "Karabiner") and PCKeyboardHack (now "Seil") to remap my CapsLock key to F19. Previously when using Slate and Phoenix I could take advantage of their modal modifiers so I could push things like F19(CapsLock)+Right Arrow, etc. Voila, my CapsLock now has an actual useful function. Is there any way to do something similar with Amethyst?

Trello Card

ianyh commented 10 years ago

No, but there should be.

amonks commented 9 years ago

This is working for me just fine out-of-the-box.

@cro My Karabiner+Seil setup is as follows. I'm assuming yours is similar.

In Seil, I remapped capslock to F19. In Karabiner, I remapped F19 to ctrl-shift-command-option.

When I open up Keyboard Viewer and hold down capslock, all four modifiers are highlighted. As far as OSX is concerned, I'm literally holding down all four keys. Apps like Amethyst don't have to do anything extra to support this setup.

Just make ctrl-shift-command-option your mod1 in Amethyst and you should be good to go.

Here's that mod1 configuration in my .amethyst file:

"mod1": [
    "option",
    "shift",
    "control",
    "command"
],

And here's the relevant Karabiner item:

<item>
    <name>F19 to Hyper/Escape</name>
    <appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix>
    <identifier>private.f192f19_escape</identifier>
    <autogen>
        --KeyOverlaidModifier--
        KeyCode::F19,
        KeyCode::COMMAND_L,
        ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L,
        KeyCode::ESCAPE
    </autogen>
</item>
ianyh commented 7 years ago

I think this is fixed. A lot of how keyboard types were handled has changed.