Add common LED names to xkbcommon-names.h

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2012-05-09 20:18:30 +01:00
parent 693d0578f2
commit 5a3771d149
2 changed files with 6 additions and 2 deletions

View File

@ -32,4 +32,8 @@
#define XKB_MOD_NAME_ALT "Mod1" #define XKB_MOD_NAME_ALT "Mod1"
#define XKB_MOD_NAME_LOGO "Mod4" #define XKB_MOD_NAME_LOGO "Mod4"
#define XKB_LED_NAME_CAPS "Caps Lock"
#define XKB_LED_NAME_NUM "Num Lock"
#define XKB_LED_NAME_SCROLL "Scroll Lock"
#endif #endif

View File

@ -152,7 +152,7 @@ test_update_key(struct xkb_keymap *keymap)
print_state(state); print_state(state);
assert(xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CAPS, assert(xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CAPS,
XKB_STATE_LOCKED)); XKB_STATE_LOCKED));
assert(xkb_state_led_name_is_active(state, XKB_MOD_NAME_CAPS)); assert(xkb_state_led_name_is_active(state, XKB_LED_NAME_CAPS));
num_syms = xkb_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms); num_syms = xkb_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms);
assert(num_syms == 1 && syms[0] == XKB_KEY_Q); assert(num_syms == 1 && syms[0] == XKB_KEY_Q);
@ -161,7 +161,7 @@ test_update_key(struct xkb_keymap *keymap)
xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_UP); xkb_state_update_key(state, KEY_CAPSLOCK + EVDEV_OFFSET, XKB_KEY_UP);
assert(!xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CAPS, assert(!xkb_state_mod_name_is_active(state, XKB_MOD_NAME_CAPS,
XKB_STATE_EFFECTIVE)); XKB_STATE_EFFECTIVE));
assert(!xkb_state_led_name_is_active(state, XKB_MOD_NAME_CAPS)); assert(!xkb_state_led_name_is_active(state, XKB_LED_NAME_CAPS));
num_syms = xkb_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms); num_syms = xkb_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms);
assert(num_syms == 1 && syms[0] == XKB_KEY_q); assert(num_syms == 1 && syms[0] == XKB_KEY_q);