mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
config: support libinput sendEventsMode
This allows to enable / disable libinput devices. Co-Authored-By: @Consolatis
This commit is contained in:
parent
9456b50983
commit
6fb06c54c2
6 changed files with 78 additions and 6 deletions
|
|
@ -24,6 +24,7 @@ libinput_category_init(struct libinput_category *l)
|
|||
l->middle_emu = -1;
|
||||
l->dwt = -1;
|
||||
l->click_method = -1;
|
||||
l->send_events_mode = -1;
|
||||
}
|
||||
|
||||
enum lab_libinput_device_type
|
||||
|
|
|
|||
|
|
@ -461,6 +461,29 @@ get_accel_profile(const char *s)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
get_send_events_mode(const char *s)
|
||||
{
|
||||
if (!s) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
int ret = parse_bool(s, -1);
|
||||
if (ret >= 0) {
|
||||
return ret
|
||||
? LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
|
||||
: LIBINPUT_CONFIG_SEND_EVENTS_DISABLED;
|
||||
}
|
||||
|
||||
if (!strcasecmp(s, "disabledOnExternalMouse")) {
|
||||
return LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE;
|
||||
}
|
||||
|
||||
err:
|
||||
wlr_log(WLR_INFO, "Not a recognised send events mode");
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void
|
||||
fill_libinput_category(char *nodename, char *content)
|
||||
{
|
||||
|
|
@ -576,6 +599,9 @@ fill_libinput_category(char *nodename, char *content)
|
|||
} else {
|
||||
wlr_log(WLR_ERROR, "invalid clickMethod");
|
||||
}
|
||||
} else if (!strcasecmp(nodename, "sendEventsMode")) {
|
||||
current_libinput_category->send_events_mode =
|
||||
get_send_events_mode(content);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue