stumpwm / mahogany

A stumpwm like Wayland compositor
GNU General Public License v2.0
220 stars 12 forks source link

Add key parsing and creation #25

Closed sdilts closed 1 year ago

sdilts commented 1 year ago

Add key structure and key creation / parsing code. This is taken mostly from kmap.lisp and keytrans.lisp in stumpwm.

The major changes are due to using xkbcommon instead of clx. Modifiers are stored in a bit mask in xkbcommon, so we use one here to avoid needing to translated between the two representations.

We also let xkbcommon handle altgr keycodes and key translation in general. I'm not sure if we need to do anything special for altgr keycodes like stumpwm does, but from what I can see in xkbcommon's documentation, it should take care of that for us. I don't have a keyboard with that key to test.

We are also missing the hyper key: it's not clear to me which modifier that actually is. It will need to be fixed or removed from the parsing functions so it doesn't trip anyone up in the future.