e_input_init(Ecore_Evas *ee)
{
E_Input_Device *dev;
+ E_Input_Libinput_Backend backend = E_INPUT_LIBINPUT_BACKEND_UDEV;
if (++_e_input_init_count != 1) return _e_input_init_count;
e_input->window = ecore_evas_window_get(ee);
e_input_device_window_set(dev, e_input->window);
- if (!e_input_device_input_backend_create(dev, "libinput_udev"))
+ if (getenv("E_INPUT_USE_LIBINPUT_UDEV_BACKEND"))
+ backend = E_INPUT_LIBINPUT_BACKEND_UDEV;
+ else if (getenv("E_INPUT_USE_LIBINPUT_PATH_BACKEND"))
+ backend = E_INPUT_LIBINPUT_BACKEND_PATH;
+
+ if (!e_input_device_input_backend_create(dev, backend))
{
EINA_LOG_ERR("Failed to create device\n");
goto device_create_err;
E_INPUT_SEAT_TOUCH = (1 << 2),
} E_Input_Seat_Capabilities;
+typedef enum _E_Input_Libinput_Backend
+{
+ E_INPUT_LIBINPUT_BACKEND_UDEV = 1,
+ E_INPUT_LIBINPUT_BACKEND_PATH
+} E_Input_Libinput_Backend;
+
struct _E_Input_Event_Input_Device_Add
{
const char *name; /* descriptive device name */
EINTERN Eina_Bool e_input_device_close(E_Input_Device *dev);
EINTERN void e_input_device_keyboard_cached_context_set(struct xkb_context *ctx);
EINTERN void e_input_device_keyboard_cached_keymap_set(struct xkb_keymap *map);
-EINTERN Eina_Bool e_input_device_input_backend_create(E_Input_Device *dev, const char *backend);
+EINTERN Eina_Bool e_input_device_input_backend_create(E_Input_Device *dev, E_Input_Libinput_Backend backend);
EINTERN Eina_Bool e_input_device_input_create_libinput_udev(E_Input_Device *dev);
EINTERN Eina_Bool e_input_device_input_create_libinput_path(E_Input_Device *dev);
EINTERN void e_input_device_window_set(E_Input_Device *dev, unsigned int window);
}
EINTERN Eina_Bool
-e_input_device_input_backend_create(E_Input_Device *dev, const char *backend)
+e_input_device_input_backend_create(E_Input_Device *dev, E_Input_Libinput_Backend backend)
{
Eina_Bool res = EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(backend, EINA_FALSE);
- if (!strncmp(backend, "libinput_udev", strlen("libinput_udev")))
- res = e_input_device_input_create_libinput_udev(dev);
- else if (!strncmp(backend, "libinput_path", strlen("libinput_path")))
- res = e_input_device_input_create_libinput_path(dev);
+ if (backend == E_INPUT_LIBINPUT_BACKEND_UDEV)
+ {
+ res = e_input_device_input_create_libinput_udev(dev);
+ }
+ else if (backend == E_INPUT_LIBINPUT_BACKEND_PATH)
+ {
+ res = e_input_device_input_create_libinput_path(dev);
+ }
return res;
}