mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
One giant commit, but I didn't know how to split this up easier. The problem is a misunderstanding in what the button type is and the code that built on that misunderstanding, requiring a lot of interdependent parts to be updated at once. The button _type_ is the physical description of the button. The button _action type_ is what will happen when you hit the buttons. The type is read-only, since we're not dealing with mr potato head here. The action is adjustible and we now support buttons, keys and special in-hardware actions (e.g. dpi changes). A few FIXMEs still in place, e.g. we don't handle modifiers with keys. For buttons we just take numerical button numbers. i.e. we can map a button to button 4, which will result in BTN_SIDE, and eventually logical button 8 in X. For keys we take KEY_FOO, since eventually we want this to come out as that (could do this for button as well I guess). Modifiers are currently ignored. For special actions we have a enum of actions we support. The button type enum is thus reduced a lot, and everything needs to be switched. This breaks ratbag-command change-button, will be fixed later since it's misdesigned as it is anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>