mirror of
https://github.com/labwc/labwc.git
synced 2026-02-20 01:40:22 -05:00
Complete libinput configuration
This commit is contained in:
parent
417763e8f8
commit
416499624e
5 changed files with 168 additions and 50 deletions
45
src/config/libinput.c
Normal file
45
src/config/libinput.c
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include "config/libinput.h"
|
||||
#include "config/rcxml.h"
|
||||
static void
|
||||
libinput_category_init(struct libinput_category *l)
|
||||
{
|
||||
l->name = NULL;
|
||||
l->pointer_speed = -2;
|
||||
l->natural_scroll = -1;
|
||||
l->left_handed = -1;
|
||||
l->tap = LIBINPUT_CONFIG_TAP_ENABLED;
|
||||
l->accel_profile = -1;
|
||||
l->middle_emu = -1;
|
||||
l->dwt = -1;
|
||||
}
|
||||
|
||||
enum device_type
|
||||
get_device_type(const char *s)
|
||||
{
|
||||
if (!s) {
|
||||
return DEFAULT_DEVICE;
|
||||
}
|
||||
if (!strcasecmp(s, "touch")) {
|
||||
return TOUCH_DEVICE;
|
||||
}
|
||||
if (!strcasecmp(s, "non-touch")) {
|
||||
return NON_TOUCH_DEVICE;
|
||||
}
|
||||
return DEFAULT_DEVICE;
|
||||
}
|
||||
|
||||
struct libinput_category *
|
||||
libinput_category_create()
|
||||
{
|
||||
struct libinput_category *l = calloc(1, sizeof(struct libinput_category));
|
||||
if (!l) {
|
||||
return NULL;
|
||||
}
|
||||
libinput_category_init(l);
|
||||
wl_list_insert(&rc.libinput_categories, &l->link);
|
||||
return l;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue