2 #include "e_input_private.h"
3 #include "e_input_event.h"
4 #include "e_keyrouter.h"
8 static gboolean input_dispatch(GSource *source, GSourceFunc callback, gpointer user_data);
9 static gboolean input_thread_prepare(GSource *source, gint *time);
11 static E_Input_Event_Source *g_input_event_source = NULL;
12 static GList *_key_event_list = NULL;
14 GSourceFuncs input_event_funcs = {
15 .prepare = input_thread_prepare,
17 .dispatch = input_dispatch,
28 _e_input_ecore_device_class_to_string(Ecore_Device_Class clas)
32 case ECORE_DEVICE_CLASS_NONE:
35 case ECORE_DEVICE_CLASS_SEAT:
38 case ECORE_DEVICE_CLASS_KEYBOARD:
41 case ECORE_DEVICE_CLASS_MOUSE:
44 case ECORE_DEVICE_CLASS_TOUCH:
47 case ECORE_DEVICE_CLASS_PEN:
50 case ECORE_DEVICE_CLASS_WAND:
53 case ECORE_DEVICE_CLASS_GAMEPAD:
61 static Ecore_Device_Class
62 _e_input_seat_cap_to_ecore_device_class(unsigned int cap)
66 case E_INPUT_SEAT_POINTER:
67 return ECORE_DEVICE_CLASS_MOUSE;
68 case E_INPUT_SEAT_KEYBOARD:
69 return ECORE_DEVICE_CLASS_KEYBOARD;
70 case E_INPUT_SEAT_TOUCH:
71 return ECORE_DEVICE_CLASS_TOUCH;
73 return ECORE_DEVICE_CLASS_NONE;
75 return ECORE_DEVICE_CLASS_NONE;
79 _e_input_ecore_device_info_free(void *data EINA_UNUSED, void *ev)
81 Ecore_Event_Device_Info *e;
84 eina_stringshare_del(e->name);
85 eina_stringshare_del(e->identifier);
86 eina_stringshare_del(e->seatname);
92 _e_input_ecore_device_event(Ecore_Device *dev, const char* seat_name, Eina_Bool flag)
94 Ecore_Event_Device_Info *e;
96 const char *name, *identifier;
98 ecore_thread_main_loop_begin();
100 if (!(name = ecore_device_name_get(dev))) goto end;
101 if (!(identifier = ecore_device_identifier_get(dev))) goto end;
103 if (!(e = calloc(1, sizeof(Ecore_Event_Device_Info)))) goto end;
105 e_input = e_input_get();
107 e->window = e_input?e_input->window:(Ecore_Window)0;
108 e->name = eina_stringshare_add(name);
109 e->identifier = eina_stringshare_add(identifier);
110 if (seat_name && strlen(seat_name))
111 e->seatname = eina_stringshare_add(seat_name);
113 e->seatname = eina_stringshare_add(name);
114 e->clas = ecore_device_class_get(dev);
115 e->subclas = ecore_device_subclass_get(dev);
118 ecore_event_add(ECORE_EVENT_DEVICE_ADD, e, _e_input_ecore_device_info_free, NULL);
120 ecore_event_add(ECORE_EVENT_DEVICE_DEL, e, _e_input_ecore_device_info_free, NULL);
123 ecore_thread_main_loop_end();
126 static E_Input_Seat *
127 _seat_create(E_Input_Backend *input, const char *seat)
130 Ecore_Device *ecore_dev = NULL;
131 E_Device *e_dev = NULL;
133 ecore_thread_main_loop_begin();
135 /* create an evas device of a seat */
136 ecore_dev = ecore_device_add();
139 ERR("Failed to create an ecore device for a seat !\n");
140 ecore_thread_main_loop_end();
144 ecore_device_name_set(ecore_dev, seat);
145 ecore_device_identifier_set(ecore_dev, "Enlightenment seat");
146 ecore_device_class_set(ecore_dev, ECORE_DEVICE_CLASS_SEAT);
147 ecore_device_subclass_set(ecore_dev, ECORE_DEVICE_SUBCLASS_NONE);
149 /* create an e device of a seat */
150 e_dev = e_device_new();
153 ERR("Failed to create an ecore device for a seat !\n");
154 ecore_thread_main_loop_end();
158 e_device_name_set(e_dev, seat);
159 e_device_identifier_set(e_dev, "Enlightenment seat");
160 e_device_class_set(e_dev, ECORE_DEVICE_CLASS_SEAT);
161 e_device_subclass_set(e_dev, ECORE_DEVICE_SUBCLASS_NONE);
163 /* try to allocate space for new seat */
164 if (!(s = calloc(1, sizeof(E_Input_Seat))))
166 ecore_device_del(ecore_dev);
167 ecore_thread_main_loop_end();
172 s->name = eina_stringshare_add(seat);
173 s->ecore_dev = ecore_dev;
176 /* add this new seat to list */
177 input->dev->seats = eina_list_append(input->dev->seats, s);
180 ecore_event_add(E_INPUT_EVENT_SEAT_ADD, NULL, NULL, NULL);
181 ecore_thread_main_loop_end();
183 _e_input_ecore_device_event(ecore_dev, seat, EINA_TRUE);
188 static E_Input_Seat *
189 _seat_get(E_Input_Backend *input, const char *seat)
194 /* search for this name in existing seats */
195 EINA_LIST_FOREACH(input->dev->seats, l, s)
196 if (!strcmp(s->name, seat))
199 return _seat_create(input, seat);
203 _e_input_add_ecore_device(E_Input_Evdev *edev, Ecore_Device_Class clas)
205 const Eina_List *dev_list = NULL;
207 Ecore_Device *dev = NULL;
208 E_Device *e_dev = NULL;
209 const char *identifier;
211 if (!edev || !edev->path) return EINA_FALSE;
213 dev_list = ecore_device_list();
216 EINA_LIST_FOREACH(dev_list, l, dev)
219 identifier = ecore_device_identifier_get(dev);
220 if (!identifier) continue;
221 if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
223 ERR("Found same device in device list");
229 // create ecore device info
230 dev = ecore_device_add();
233 ERR("Failed to create ecore device");
234 edev->ecore_dev = NULL;
238 ecore_device_name_set(dev, libinput_device_get_name(edev->device));
239 ecore_device_identifier_set(dev, edev->path);
240 ecore_device_class_set(dev, clas);
241 ecore_device_subclass_set(dev, ECORE_DEVICE_SUBCLASS_NONE);
243 if (!edev->ecore_dev)
245 if (!edev->ecore_dev_list || (eina_list_count(edev->ecore_dev_list) == 0))
247 /* 1st Ecore_Device is added */
248 edev->ecore_dev = ecore_device_ref(dev);
252 /* 3rd or more Ecore_Device is added */
253 edev->ecore_dev_list = eina_list_append(edev->ecore_dev_list, ecore_device_ref(dev));
258 /* 2nd Ecore_Device is added */
259 edev->ecore_dev_list = eina_list_append(edev->ecore_dev_list, edev->ecore_dev);
260 edev->ecore_dev = NULL;
262 edev->ecore_dev_list = eina_list_append(edev->ecore_dev_list, ecore_device_ref(dev));
265 const GList *device_list = e_device_list_get();
266 const gchar *device_identifier;
267 for (GList *list = g_list_first((GList *)device_list); list; list = list->next)
269 E_Device *device = (E_Device *)list->data;
270 if (!device) continue;
271 device_identifier = e_device_identifier_get(device);
272 if (!device_identifier) continue;
274 if ((e_device_class_get(device) == clas) && (!strcmp(device_identifier, edev->path)))
283 // create E_Device info
284 e_dev = e_device_new();
287 ERR("Failed to add e device");
293 e_device_name_set(e_dev, libinput_device_get_name(edev->device));
294 e_device_identifier_set(e_dev, edev->path);
295 e_device_class_set(e_dev, clas);
296 e_device_subclass_set(e_dev, ECORE_DEVICE_SUBCLASS_NONE);
300 if (!edev->e_dev_list || (g_list_length(edev->e_dev_list) == 0))
302 /* 1st Ecore_Device is added */
303 edev->e_dev = g_object_ref(e_dev);
307 /* 3rd or more Ecore_Device is added */
308 edev->e_dev_list = g_list_append(edev->e_dev_list, g_object_ref(e_dev));
313 /* 2nd Ecore_Device is added */
314 edev->e_dev_list = g_list_append(edev->e_dev_list, edev->e_dev);
317 edev->e_dev_list = g_list_append(edev->e_dev_list, g_object_ref(e_dev));
320 _e_input_ecore_device_event(dev, edev->seat ? edev->seat->name : NULL, EINA_TRUE);
322 INF("[Add Device] device name(%s), identifier(%s), class(%s)", e_device_name_get(e_dev), edev->path, _e_input_ecore_device_class_to_string(clas));
328 _e_input_remove_ecore_device(E_Input_Evdev *edev, Ecore_Device_Class clas)
330 Eina_Bool ret = EINA_FALSE;
331 const Eina_List *dev_list = NULL, *l;
332 const GList *e_dev_list = NULL;
333 Eina_List *ll, *ll_next;
334 Ecore_Device *dev = NULL, *data;
335 const char *identifier;
336 const gchar *device_identifier;
337 const char *device_remove_log = NULL;
339 if (!edev->path) return EINA_FALSE;
341 dev_list = ecore_device_list();
342 if (!dev_list) return EINA_FALSE;
344 EINA_LIST_FOREACH(dev_list, l, dev)
347 identifier = ecore_device_identifier_get(dev);
348 if (!identifier) continue;
349 if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
353 ecore_device_unref(dev);
354 edev->ecore_dev = NULL;
356 else if (edev->ecore_dev_list)
358 EINA_LIST_FOREACH_SAFE(edev->ecore_dev_list, ll, ll_next, data)
362 ecore_device_unref(dev);
363 edev->ecore_dev_list = eina_list_remove_list(edev->ecore_dev_list, ll);
367 _e_input_ecore_device_event(dev, edev->seat ? edev->seat->name : NULL, EINA_FALSE);
368 ecore_device_del(dev);
373 e_dev_list = e_device_list_get();
376 ERR("Failed to get e device list");
380 for (GList *list = g_list_first((GList *)e_dev_list); list; list = list->next)
382 E_Device *device = (E_Device *)list->data;
383 if (!device) continue;
384 device_identifier = e_device_identifier_get(device);
385 if (!device_identifier) continue;
387 if ((e_device_class_get(device) == clas) && (!strcmp(device_identifier, edev->path)))
389 device_remove_log = eina_stringshare_printf("[Remove Device] device name(%s), identifier(%s), class(%s)",
390 e_device_name_get(device),
392 _e_input_ecore_device_class_to_string(clas));
396 g_object_unref(device);
399 else if (edev->e_dev_list)
401 GList *del_list = g_list_find(edev->e_dev_list, device);
404 edev->e_dev_list = g_list_delete_link(edev->e_dev_list, del_list);
411 if (device_remove_log)
413 INF("%s", device_remove_log);
414 eina_stringshare_del(device_remove_log);
421 _e_input_device_add(E_Input_Evdev *edev)
423 Eina_Bool ret = EINA_FALSE;
424 Ecore_Device_Class clas = ECORE_DEVICE_CLASS_NONE;
426 if (edev->caps & E_INPUT_SEAT_POINTER)
428 if (!e_devicemgr_detent_is_detent(libinput_device_get_name(edev->device)))
429 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_POINTER);
430 ret = _e_input_add_ecore_device(edev, clas);
432 if (edev->caps & E_INPUT_SEAT_KEYBOARD)
434 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_KEYBOARD);
435 ret = _e_input_add_ecore_device(edev, clas);
437 if (edev->caps & E_INPUT_SEAT_TOUCH)
439 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_TOUCH);
440 ret = _e_input_add_ecore_device(edev, clas);
447 _e_input_device_remove(E_Input_Evdev *edev)
449 Ecore_Device_Class clas = ECORE_DEVICE_CLASS_NONE;
452 if (edev->caps & E_INPUT_SEAT_POINTER)
454 if (!e_devicemgr_detent_is_detent(libinput_device_get_name(edev->device)))
455 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_POINTER);
456 _e_input_remove_ecore_device(edev, clas);
458 if (edev->caps & E_INPUT_SEAT_KEYBOARD)
460 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_KEYBOARD);
461 _e_input_remove_ecore_device(edev, clas);
463 if (edev->caps & E_INPUT_SEAT_TOUCH)
465 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_TOUCH);
466 _e_input_remove_ecore_device(edev, clas);
469 if (edev->ecore_dev_list)
471 if (eina_list_count(edev->ecore_dev_list) > 0)
473 EINA_LIST_FREE(edev->ecore_dev_list, data)
475 WRN("Invalid device is left. name: %s, identifier: %s, clas: %s\n",
476 ecore_device_name_get(data), ecore_device_identifier_get(data),
477 _e_input_ecore_device_class_to_string(ecore_device_class_get(data)));
479 ecore_device_unref(data);
480 ecore_device_del(data);
483 edev->ecore_dev_list = NULL;
488 _device_added(E_Input_Backend *input, struct libinput_device *device)
490 struct libinput_seat *libinput_seat;
491 const char *seat_name;
495 ecore_thread_main_loop_begin();
496 libinput_seat = libinput_device_get_seat(device);
497 seat_name = libinput_seat_get_logical_name(libinput_seat);
499 /* try to get a seat */
500 if (!(seat = _seat_get(input, seat_name)))
502 ERR("Could not get matching seat: %s", seat_name);
503 ecore_thread_main_loop_end();
507 /* try to create a new evdev device */
508 if (!(edev = _e_input_evdev_device_create(seat, device)))
510 ERR("Failed to create new evdev device");
511 ecore_thread_main_loop_end();
515 /* append this device to the seat */
516 seat->devices = eina_list_append(seat->devices, edev);
518 if (EINA_FALSE == _e_input_device_add(edev))
520 ERR("Failed to create evas device !\n");
521 ecore_thread_main_loop_end();
525 ecore_thread_main_loop_end();
529 _device_removed(E_Input_Backend *input, struct libinput_device *device)
533 ecore_thread_main_loop_begin();
535 /* try to get the evdev structure */
536 if (!(edev = libinput_device_get_user_data(device)))
538 ecore_thread_main_loop_end();
542 _e_input_device_remove(edev);
544 /* remove this evdev from the seat's list of devices */
545 edev->seat->devices = eina_list_remove(edev->seat->devices, edev);
547 /* destroy this evdev */
548 _e_input_evdev_device_destroy(edev);
550 ecore_thread_main_loop_end();
554 _udev_event_process(struct libinput_event *event)
556 struct libinput *libinput;
557 struct libinput_device *device;
558 E_Input_Backend *input;
559 Eina_Bool ret = EINA_TRUE;
561 libinput = libinput_event_get_context(event);
562 input = libinput_get_user_data(libinput);
563 device = libinput_event_get_device(event);
565 switch (libinput_event_get_type(event))
567 case LIBINPUT_EVENT_DEVICE_ADDED:
568 if (e_config->key_input_ttrace_enable)
570 TRACE_INPUT_BEGIN(_device_added);
571 ELOGF("INPUT", "_device_added|B|", NULL);
574 _device_added(input, device);
576 if (e_config->key_input_ttrace_enable)
579 ELOGF("INPUT", "_device_added|E|", NULL);
582 case LIBINPUT_EVENT_DEVICE_REMOVED:
583 if (e_config->key_input_ttrace_enable)
585 TRACE_INPUT_BEGIN(_device_removed);
586 ELOGF("INPUT", "_device_removed|B|", NULL);
589 _device_removed(input, device);
591 if (e_config->key_input_ttrace_enable)
594 ELOGF("INPUT", "_device_removed|E|", NULL);
605 _input_event_process(struct libinput_event *event)
607 if (_udev_event_process(event)) return;
608 if (_e_input_evdev_event_process(event)) return;
612 _input_events_process(E_Input_Backend *input)
614 struct libinput_event *event;
615 E_Input *e_input = e_input_get();
618 g_rec_mutex_lock(&e_input->libinput_mutex);
620 while ((event = libinput_get_event(input->libinput)))
622 _input_event_process(event);
623 libinput_event_destroy(event);
627 g_rec_mutex_unlock(&e_input->libinput_mutex);
631 _cb_input_dispatch(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
633 E_Input_Backend *input;
635 if (!(input = data)) return EINA_TRUE;
637 if (e_config->key_input_ttrace_enable)
639 TRACE_INPUT_BEGIN(_cb_input_dispatch);
640 ELOGF("INPUT", "_cb_input_dispatch|B|", NULL);
643 if (libinput_dispatch(input->libinput) != 0)
644 ERR("Failed to dispatch libinput events: %m");
646 /* process pending events */
647 _input_events_process(input);
649 if (e_config->key_input_ttrace_enable)
652 ELOGF("INPUT", "_cb_input_dispatch|E|", NULL);
659 _e_input_delayed_key_events_print()
664 clock_gettime(CLOCK_MONOTONIC, &tp);
665 time = (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
667 for (GList *list = g_list_first(_key_event_list); list; list = list->next)
669 Ecore_Event_Key *key = (Ecore_Event_Key *)list->data;
672 if (e_config->key_input_time_limit <= (time - key->timestamp))
673 ERR("Delayed key event : keyname(%s), keycode(%u), timestamp(%u), elapsed_time(%u ms)", key->keyname, key->keycode, key->timestamp, time - key->timestamp);
676 eina_stringshare_del(key->keyname);
679 _key_event_list = g_list_delete_link(_key_event_list, list);
681 _key_event_list = NULL;
685 input_thread_prepare(GSource *source, gint *time)
687 if (e_config->key_input_ttrace_enable)
689 TRACE_INPUT_BEGIN(e_comp_wl_focused_client_flush);
690 ELOGF("INPUT", "e_comp_wl_focused_client_flush|B|", NULL);
693 /* flush only focused client events */
694 e_comp_wl_focused_client_flush();
697 _e_input_delayed_key_events_print();
699 if (e_config->key_input_ttrace_enable)
702 ELOGF("INPUT", "e_comp_wl_focused_client_flush|E|", NULL);
712 input_dispatch(GSource *source, GSourceFunc callback, gpointer user_data)
714 InputEventSource *src = (InputEventSource *)source;
715 E_Input_Backend *input = (E_Input_Backend *)user_data;
716 if (!src) return G_SOURCE_REMOVE;
717 if (!input) return G_SOURCE_REMOVE;
719 if (e_config->key_input_ttrace_enable)
721 TRACE_INPUT_BEGIN(input_dispatch);
722 ELOGF("INPUT", "input_dispatch|B|", NULL);
725 E_Input *e_input = e_input_get();
728 cond = g_source_query_unix_fd(source, src->tag);
730 if (cond & G_IO_ERR || cond & G_IO_HUP || cond & G_IO_NVAL)
732 INF("error cond(%d)\n", cond);
733 return G_SOURCE_CONTINUE;
736 if (!input->libinput)
737 return G_SOURCE_REMOVE;
740 g_rec_mutex_lock(&e_input->libinput_mutex);
742 if (e_config->key_input_ttrace_enable)
744 TRACE_INPUT_BEGIN(libinput_dispatch);
745 ELOGF("INPUT", "libinput_dispatch|B|", NULL);
748 if (libinput_dispatch(input->libinput) != 0)
749 ERR("Failed to dispatch libinput events: %m");
751 if (e_config->key_input_ttrace_enable)
754 ELOGF("INPUT", "libinput_dispatch|E|", NULL);
758 g_rec_mutex_unlock(&e_input->libinput_mutex);
760 if (e_config->key_input_ttrace_enable)
762 TRACE_INPUT_BEGIN(_input_events_process);
763 ELOGF("INPUT", "_input_events_process|B|", NULL);
766 /* process pending events */
767 _input_events_process(input);
769 if (e_config->key_input_ttrace_enable)
772 ELOGF("INPUT", "_input_events_process|E|", NULL);
775 ELOGF("INPUT", "input_dispatch|E|", NULL);
778 e_input_event_process((GSource *)input->event_source);
780 return G_SOURCE_CONTINUE;
784 input_thread_start(void *data, Ecore_Thread *th)
787 E_Input_Backend *input;
788 GMainContext *context = NULL;
789 InputEventSource *input_event_source = NULL;
791 if (!(input = data)) return;
793 eina_thread_name_set(eina_thread_self(), "input-thread");
795 e_input_libinput_context_create(input);
797 /* enable this input */
798 if (!e_input_enable_input(input))
800 ERR("Failed to enable input");
804 /* append this input */
806 dev->inputs = eina_list_append(dev->inputs, input);
809 context = g_main_context_new();
810 g_main_context_push_thread_default(context);
812 input_event_source = (InputEventSource *)g_source_new(&input_event_funcs, sizeof(InputEventSource));
813 input_event_source->tag = g_source_add_unix_fd(&input_event_source->gsource, input->fd, G_IO_IN);
815 if (!input->event_source)
816 e_input_create_event_source(input);
819 input->input_thread_loop = g_main_loop_new(context, FALSE);
821 g_source_attach((GSource *)input->event_source, context);
823 //set the callback for this source
824 g_source_set_callback(&input_event_source->gsource, NULL, input, NULL);
825 g_source_attach(&input_event_source->gsource, context);
827 e_keyrouter_input_handler_add();
829 e_input_thread_id_set(gettid());
830 e_input_main_thread_id_set(getpid());
832 _e_input_hook_call(E_INPUT_HOOK_INPUT_THREAD_START, NULL);
834 INF("input thread start tid(%d) pid(%d)", e_input_thread_id_get(), e_input_main_thread_id_get());
836 g_main_loop_run(input->input_thread_loop);
840 input_thread_feedback(void *data, Ecore_Thread *th, void *msgdata)
842 E_Input_Backend *input;
844 INF("input thread start");
846 if (!(input = data)) return;
850 input_thread_end(void *data, Ecore_Thread *th)
852 E_Input_Backend *input;
854 if (!(input = data)) return;
855 INF("input thread complete");
857 e_input_event_source_destroy(input->event_source);
858 input->event_source = NULL;
860 g_main_loop_quit(input->input_thread_loop);
861 g_main_loop_unref(input->input_thread_loop);
862 input->input_thread_loop = NULL;
864 if (th == input->input_thread)
865 input->input_thread = NULL;
869 input_thread_cancel(void *data, Ecore_Thread *th)
871 E_Input_Backend *input;
873 if (!(input = data)) return;
875 INF("input thread cancel");
877 if (th == input->input_thread)
878 input->input_thread = NULL;
882 _e_input_key_event_list_add(Ecore_Event_Key *key)
884 Ecore_Event_Key *clone = NULL;
888 clone = E_NEW(Ecore_Event_Key, 1);
892 clone->keyname = (char *)eina_stringshare_add(key->keyname);
894 clone->keycode = key->keycode;
895 clone->timestamp = key->timestamp;
897 _key_event_list = g_list_append(_key_event_list, clone);
901 e_input_enable_input(E_Input_Backend *input)
903 EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
904 EINA_SAFETY_ON_NULL_RETURN_VAL(input->libinput, EINA_FALSE);
906 input->fd = libinput_get_fd(input->libinput);
908 if (!e_input_thread_mode_get())
913 ecore_main_fd_handler_add(input->fd, ECORE_FD_READ,
914 _cb_input_dispatch, input, NULL, NULL);
918 if (input->suspended)
920 if (libinput_resume(input->libinput) != 0)
923 input->suspended = EINA_FALSE;
925 /* process pending events */
926 _input_events_process(input);
929 input->enabled = EINA_TRUE;
930 input->suspended = EINA_FALSE;
935 input->enabled = EINA_FALSE;
936 if (!e_input_thread_mode_get())
939 ecore_main_fd_handler_del(input->hdlr);
947 e_input_disable_input(E_Input_Backend *input)
949 EINA_SAFETY_ON_NULL_RETURN(input);
950 EINA_SAFETY_ON_TRUE_RETURN(input->suspended);
952 /* suspend this input */
953 libinput_suspend(input->libinput);
955 /* process pending events */
956 _input_events_process(input);
958 input->suspended = EINA_TRUE;
960 if (e_input_thread_mode_get())
962 if (input->input_thread && !ecore_thread_check(input->input_thread))
963 ecore_thread_cancel(input->input_thread);
968 e_input_seat_evdev_list_get(E_Input_Seat *seat)
970 EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
971 return seat->devices;
974 E_API E_Input_Event_Source *
975 e_input_event_source_get()
977 return g_input_event_source;
981 e_input_thread_mode_get()
984 return e_config->input_thread_mode;
990 e_input_create_event_source(E_Input_Backend *input)
992 input->event_source = e_input_event_source_create();
994 g_input_event_source = input->event_source;
997 EINTERN void e_input_thread_run(E_Input_Backend *input)
999 input->input_thread = ecore_thread_feedback_run(input_thread_start, input_thread_feedback, input_thread_end, input_thread_cancel, input, EINA_FALSE);