mooz / xkeysnail

Yet another keyboard remapping tool for X environment
895 stars 112 forks source link

A condition for define_modmap() #13

Open r3zn opened 6 years ago

r3zn commented 6 years ago

I want to use muhenkan key as an extra modifier key like this:

It is impossible to write K("Muhenkan-h"): K("left"). But if define_modmap() receives a condition, the demand is satisfied.

For example (pseudo code):

define_modmap({
    Key.H: Key.LEFT,
    Key.J: Key.DOWN,
    Key.K: Key.UP,
    Key.L: Key.RIGHT,
}, condition=WHILE_MUHENKAN_PRESSED)

:)

joshgoebel commented 2 years ago

You can do this with modmap but you need to map Muhenkan to one of the KNOWN modifiers first... currently we do not allow "arbitrary" modifiers... Then you'd just do this using a keymap:

# psuedo code
modmap {
  MUHENKAN: RCtrl
}

keymap {
K("RCtrl-H"): K("left")
}

Otherwise you'd need to edit key#Modifier such that the Muhenkan key was seen as a REAL modifier.

joshgoebel commented 2 years ago

currently we do not allow "arbitrary" modifiers...

My new fork now allows arbitrary modifiers... though you may still need to make sure your software you're using actually allows them as well, since usually that is the problem, not the keymapper.

https://github.com/joshgoebel/keyszer