mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Add support for XKB_LED_NAME_COMPOSE and XKB_LED_NAME_KANA USB HID LEDs
Requires xkbcommon 1.8.0
This commit is contained in:
parent
c2327248f8
commit
62c86fb975
3 changed files with 7 additions and 3 deletions
|
|
@ -16,12 +16,14 @@
|
||||||
#include <wlr/types/wlr_input_device.h>
|
#include <wlr/types/wlr_input_device.h>
|
||||||
#include <xkbcommon/xkbcommon.h>
|
#include <xkbcommon/xkbcommon.h>
|
||||||
|
|
||||||
#define WLR_LED_COUNT 3
|
#define WLR_LED_COUNT 5
|
||||||
|
|
||||||
enum wlr_keyboard_led {
|
enum wlr_keyboard_led {
|
||||||
WLR_LED_NUM_LOCK = 1 << 0,
|
WLR_LED_NUM_LOCK = 1 << 0,
|
||||||
WLR_LED_CAPS_LOCK = 1 << 1,
|
WLR_LED_CAPS_LOCK = 1 << 1,
|
||||||
WLR_LED_SCROLL_LOCK = 1 << 2,
|
WLR_LED_SCROLL_LOCK = 1 << 2,
|
||||||
|
WLR_LED_COMPOSE = 1 << 3,
|
||||||
|
WLR_LED_KANA = 1 << 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define WLR_MODIFIER_COUNT 8
|
#define WLR_MODIFIER_COUNT 8
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,8 @@ drm = dependency('libdrm',
|
||||||
'tests=false',
|
'tests=false',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
xkbcommon = dependency(
|
xkbcommon = dependency('xkbcommon',
|
||||||
'xkbcommon',
|
version: '>=1.8.0',
|
||||||
fallback: 'libxkbcommon',
|
fallback: 'libxkbcommon',
|
||||||
default_options: [
|
default_options: [
|
||||||
'enable-tools=false',
|
'enable-tools=false',
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,8 @@ bool wlr_keyboard_set_keymap(struct wlr_keyboard *kb, struct xkb_keymap *keymap)
|
||||||
XKB_LED_NAME_NUM,
|
XKB_LED_NAME_NUM,
|
||||||
XKB_LED_NAME_CAPS,
|
XKB_LED_NAME_CAPS,
|
||||||
XKB_LED_NAME_SCROLL,
|
XKB_LED_NAME_SCROLL,
|
||||||
|
XKB_LED_NAME_COMPOSE,
|
||||||
|
XKB_LED_NAME_KANA,
|
||||||
};
|
};
|
||||||
for (size_t i = 0; i < WLR_LED_COUNT; ++i) {
|
for (size_t i = 0; i < WLR_LED_COUNT; ++i) {
|
||||||
kb->led_indexes[i] = xkb_map_led_get_index(kb->keymap, led_names[i]);
|
kb->led_indexes[i] = xkb_map_led_get_index(kb->keymap, led_names[i]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue