valpackett / evscript

A tiny sandboxed Dyon scripting environment for evdev input devices that lets you do e.g. xcape in Wayland | now on https://codeberg.org/valpackett/evscript
https://codeberg.org/valpackett/evscript
The Unlicense
121 stars 7 forks source link

Add Hyper_L, Hyper_R and Mode_switch keys to the stdlib #16

Closed yilkalargaw closed 2 years ago

yilkalargaw commented 2 years ago

I had an xcape setup in which I use caps_lock and semicolon as hyper keys and I can't refer to them as key functions. Can they be added to to the stdlib to allow people who use the spacecadet modifiers?

valpackett commented 2 years ago

I'm not sure what you mean by "can't refer to them as key functions"??

yilkalargaw commented 2 years ago

I get an error when I say use any of the following

xcape(mut should_lhyper, evt, KEY_LEFTHYPER(), [KEY_Semicolon()])
xcape(mut should_lhyper, evt, KEY_HyperL(), [KEY_Semicolon()])
valpackett commented 2 years ago

Ah. Well, there is no "LEFTHYPER" in input-event-codes, which is why we can't add them. As far as evdev is concerned, hyper does not exist. Hyper (and Super) are purely xkb (libxkbcommon) concepts, you can tell xkb to interpret some random key that actually exists as Hyper and use that key here. For example KEY_F15 like in that article or something.

yilkalargaw commented 2 years ago

Thank you very much. I did as you suggested and it worked.