diff options
author | Tudor Brindus <me@tbrindus.ca> | 2020-10-31 18:05:39 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-10-31 23:15:21 +0100 |
commit | 7c6e06fd13ad3b96375da606d1483c4d19df38af (patch) | |
tree | e5f9d914642587636e0fa23d042e5d3ba938fd4a /include | |
parent | 85757665e6e1393773b36282aa244feb10b7a5fe (diff) |
types/wlr_keyboard: use bitmasks for wlr_keyboard_led and wlr_keyboard_modifier enums
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_keyboard.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h index c3e36054..c1a19a8e 100644 --- a/include/wlr/types/wlr_keyboard.h +++ b/include/wlr/types/wlr_keyboard.h @@ -18,22 +18,22 @@ #define WLR_LED_COUNT 3 enum wlr_keyboard_led { - WLR_LED_NUM_LOCK = 1, - WLR_LED_CAPS_LOCK = 2, - WLR_LED_SCROLL_LOCK = 4, + WLR_LED_NUM_LOCK = 1 << 0, + WLR_LED_CAPS_LOCK = 1 << 1, + WLR_LED_SCROLL_LOCK = 1 << 2, }; #define WLR_MODIFIER_COUNT 8 enum wlr_keyboard_modifier { - WLR_MODIFIER_SHIFT = 1, - WLR_MODIFIER_CAPS = 2, - WLR_MODIFIER_CTRL = 4, - WLR_MODIFIER_ALT = 8, - WLR_MODIFIER_MOD2 = 16, - WLR_MODIFIER_MOD3 = 32, - WLR_MODIFIER_LOGO = 64, - WLR_MODIFIER_MOD5 = 128, + WLR_MODIFIER_SHIFT = 1 << 0, + WLR_MODIFIER_CAPS = 1 << 1, + WLR_MODIFIER_CTRL = 1 << 2, + WLR_MODIFIER_ALT = 1 << 3, + WLR_MODIFIER_MOD2 = 1 << 4, + WLR_MODIFIER_MOD3 = 1 << 5, + WLR_MODIFIER_LOGO = 1 << 6, + WLR_MODIFIER_MOD5 = 1 << 7, }; #define WLR_KEYBOARD_KEYS_CAP 32 |