diff --git a/meson.build b/meson.build index 0887e26..1ec048e 100644 --- a/meson.build +++ b/meson.build @@ -65,6 +65,9 @@ if cc.has_function('libinput_device_config_click_set_clickfinger_button_map', dependencies: dep_libinput) config_h.set('HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP', 1) endif +if cc.has_header_symbol('libinput.h', 'LIBINPUT_LED_COMPOSE') + config_h.set('HAVE_LIBINPUT_COMPOSE_AND_KANA', 1) +endif dir_headers = get_option('sdkdir') if dir_headers == '' diff --git a/src/xf86libinput.c b/src/xf86libinput.c index 47e8bd4..a2ecdad 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -1170,14 +1170,19 @@ xf86libinput_init_pointer_absolute(InputInfoPtr pInfo) static void xf86libinput_kbd_ctrl(DeviceIntPtr device, KeybdCtrl *ctrl) { -#define CAPSFLAG 1 -#define NUMFLAG 2 -#define SCROLLFLAG 4 - +#define CAPSFLAG 1 +#define NUMFLAG 2 +#define SCROLLFLAG 4 +#define COMPOSEFLAG 8 +#define KANAFLAG 16 static struct { int xbit, code; } bits[] = { { CAPSFLAG, LIBINPUT_LED_CAPS_LOCK }, { NUMFLAG, LIBINPUT_LED_NUM_LOCK }, { SCROLLFLAG, LIBINPUT_LED_SCROLL_LOCK }, +#ifdef HAVE_LIBINPUT_COMPOSE_AND_KANA + { COMPOSEFLAG, LIBINPUT_LED_COMPOSE }, + { KANAFLAG, LIBINPUT_LED_KANA }, +#endif { 0, 0 }, }; int i = 0;