types/wlr_keyboard: use bitmasks for wlr_keyboard_led and wlr_keyboard_modifier enums

This commit is contained in:
Tudor Brindus 2020-10-31 18:05:39 -04:00 committed by Simon Ser
parent 85757665e6
commit 7c6e06fd13

View file

@ -18,22 +18,22 @@
#define WLR_LED_COUNT 3 #define WLR_LED_COUNT 3
enum wlr_keyboard_led { enum wlr_keyboard_led {
WLR_LED_NUM_LOCK = 1, WLR_LED_NUM_LOCK = 1 << 0,
WLR_LED_CAPS_LOCK = 2, WLR_LED_CAPS_LOCK = 1 << 1,
WLR_LED_SCROLL_LOCK = 4, WLR_LED_SCROLL_LOCK = 1 << 2,
}; };
#define WLR_MODIFIER_COUNT 8 #define WLR_MODIFIER_COUNT 8
enum wlr_keyboard_modifier { enum wlr_keyboard_modifier {
WLR_MODIFIER_SHIFT = 1, WLR_MODIFIER_SHIFT = 1 << 0,
WLR_MODIFIER_CAPS = 2, WLR_MODIFIER_CAPS = 1 << 1,
WLR_MODIFIER_CTRL = 4, WLR_MODIFIER_CTRL = 1 << 2,
WLR_MODIFIER_ALT = 8, WLR_MODIFIER_ALT = 1 << 3,
WLR_MODIFIER_MOD2 = 16, WLR_MODIFIER_MOD2 = 1 << 4,
WLR_MODIFIER_MOD3 = 32, WLR_MODIFIER_MOD3 = 1 << 5,
WLR_MODIFIER_LOGO = 64, WLR_MODIFIER_LOGO = 1 << 6,
WLR_MODIFIER_MOD5 = 128, WLR_MODIFIER_MOD5 = 1 << 7,
}; };
#define WLR_KEYBOARD_KEYS_CAP 32 #define WLR_KEYBOARD_KEYS_CAP 32