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

Multiple keys remapings - How to contribute #12

Closed sandangel closed 4 years ago

sandangel commented 4 years ago

Hi, I would like to help with the feature to allow multiple keys remappings like <super>c to <ctrl>c or <alt>Left to <ctrl>Left, those are impossible to remap under Wayland with xkb. Do you think this is possible with evscript and what is the approach for this?

valpackett commented 4 years ago

evscript does not remap (unless you want to proxy all keys through it and disable the original keyboard from the compositor). If you're okay with the original key combo also being pressed, that's easy.

sandangel commented 4 years ago

Oh I see. Is there a way to disable the event generated by the original keys and only emit the key events that we want? If we can export the function to disable a key event, that should be fairly easy to implement key remap in dyon script

valpackett commented 4 years ago

Only if you want to proxy all events and exclude the original keyboard in the compositor.

You can't disable events on an existing keyboard device. evscript (and everything, really) has read only access to actual keyboards' /dev/input/* entries.

sandangel commented 4 years ago

@myfreeweb OK, thank you. I will try a different way since this seen to be a big task