2 #include "e_input_intern.h"
3 #include "e_input_private.h"
4 #include "e_input_event_intern.h"
5 #include "e_keyrouter_intern.h"
6 #include "e_comp_wl_intern.h"
10 static gboolean input_dispatch(GSource *source, GSourceFunc callback, gpointer user_data);
11 static gboolean input_thread_prepare(GSource *source, gint *time);
13 static E_Input_Event_Source *g_input_event_source = NULL;
14 static GList *_key_event_list = NULL;
16 GSourceFuncs input_event_funcs = {
17 .prepare = input_thread_prepare,
19 .dispatch = input_dispatch,
30 _e_input_ecore_device_class_to_string(Ecore_Device_Class clas)
34 case ECORE_DEVICE_CLASS_NONE:
37 case ECORE_DEVICE_CLASS_SEAT:
40 case ECORE_DEVICE_CLASS_KEYBOARD:
43 case ECORE_DEVICE_CLASS_MOUSE:
46 case ECORE_DEVICE_CLASS_TOUCH:
49 case ECORE_DEVICE_CLASS_PEN:
52 case ECORE_DEVICE_CLASS_WAND:
55 case ECORE_DEVICE_CLASS_GAMEPAD:
63 static Ecore_Device_Class
64 _e_input_seat_cap_to_ecore_device_class(unsigned int cap)
68 case E_INPUT_SEAT_POINTER:
69 return ECORE_DEVICE_CLASS_MOUSE;
70 case E_INPUT_SEAT_KEYBOARD:
71 return ECORE_DEVICE_CLASS_KEYBOARD;
72 case E_INPUT_SEAT_TOUCH:
73 return ECORE_DEVICE_CLASS_TOUCH;
75 return ECORE_DEVICE_CLASS_NONE;
77 return ECORE_DEVICE_CLASS_NONE;
81 _e_input_ecore_device_info_free(void *data EINA_UNUSED, void *ev)
83 Ecore_Event_Device_Info *e;
86 eina_stringshare_del(e->name);
87 eina_stringshare_del(e->identifier);
88 eina_stringshare_del(e->seatname);
94 _e_input_ecore_device_event(Ecore_Device *dev, const char* seat_name, Eina_Bool flag)
96 Ecore_Event_Device_Info *e;
98 const char *name, *identifier;
100 ecore_thread_main_loop_begin();
102 if (!(name = ecore_device_name_get(dev))) goto end;
103 if (!(identifier = ecore_device_identifier_get(dev))) goto end;
105 if (!(e = calloc(1, sizeof(Ecore_Event_Device_Info)))) goto end;
107 e_input = e_input_get();
109 e->window = e_input?e_input->window:(Ecore_Window)0;
110 e->name = eina_stringshare_add(name);
111 e->identifier = eina_stringshare_add(identifier);
112 if (seat_name && strlen(seat_name))
113 e->seatname = eina_stringshare_add(seat_name);
115 e->seatname = eina_stringshare_add(name);
116 e->clas = ecore_device_class_get(dev);
117 e->subclas = ecore_device_subclass_get(dev);
120 ecore_event_add(ECORE_EVENT_DEVICE_ADD, e, _e_input_ecore_device_info_free, NULL);
122 ecore_event_add(ECORE_EVENT_DEVICE_DEL, e, _e_input_ecore_device_info_free, NULL);
125 ecore_thread_main_loop_end();
128 static E_Input_Seat *
129 _seat_create(E_Input_Backend *input, const char *seat)
132 Ecore_Device *ecore_dev = NULL;
133 E_Device *e_dev = NULL;
135 ecore_thread_main_loop_begin();
137 /* create an evas device of a seat */
138 ecore_dev = ecore_device_add();
141 ERR("Failed to create an ecore device for a seat !\n");
142 ecore_thread_main_loop_end();
146 ecore_device_name_set(ecore_dev, seat);
147 ecore_device_identifier_set(ecore_dev, "Enlightenment seat");
148 ecore_device_class_set(ecore_dev, ECORE_DEVICE_CLASS_SEAT);
149 ecore_device_subclass_set(ecore_dev, ECORE_DEVICE_SUBCLASS_NONE);
151 /* create an e device of a seat */
152 e_dev = e_device_new();
155 ERR("Failed to create an ecore device for a seat !\n");
156 ecore_thread_main_loop_end();
160 e_device_name_set(e_dev, seat);
161 e_device_identifier_set(e_dev, "Enlightenment seat");
162 e_device_class_set(e_dev, ECORE_DEVICE_CLASS_SEAT);
163 e_device_subclass_set(e_dev, ECORE_DEVICE_SUBCLASS_NONE);
165 /* try to allocate space for new seat */
166 if (!(s = calloc(1, sizeof(E_Input_Seat))))
168 ecore_device_del(ecore_dev);
169 ecore_thread_main_loop_end();
174 s->name = eina_stringshare_add(seat);
175 s->ecore_dev = ecore_dev;
178 /* add this new seat to list */
179 input->dev->seats = eina_list_append(input->dev->seats, s);
182 ecore_event_add(E_INPUT_EVENT_SEAT_ADD, NULL, NULL, NULL);
183 ecore_thread_main_loop_end();
185 _e_input_ecore_device_event(ecore_dev, seat, EINA_TRUE);
190 static E_Input_Seat *
191 _seat_get(E_Input_Backend *input, const char *seat)
196 /* search for this name in existing seats */
197 EINA_LIST_FOREACH(input->dev->seats, l, s)
198 if (!strcmp(s->name, seat))
201 return _seat_create(input, seat);
205 _e_input_add_ecore_device(E_Input_Evdev *edev, Ecore_Device_Class clas)
207 const Eina_List *dev_list = NULL;
209 Ecore_Device *dev = NULL;
210 E_Device *e_dev = NULL;
211 const char *identifier;
213 if (!edev || !edev->path) return EINA_FALSE;
215 dev_list = ecore_device_list();
218 EINA_LIST_FOREACH(dev_list, l, dev)
221 identifier = ecore_device_identifier_get(dev);
222 if (!identifier) continue;
223 if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
225 ERR("Found same device in device list");
231 // create ecore device info
232 dev = ecore_device_add();
235 ERR("Failed to create ecore device");
236 edev->ecore_dev = NULL;
240 ecore_device_name_set(dev, libinput_device_get_name(edev->device));
241 ecore_device_identifier_set(dev, edev->path);
242 ecore_device_class_set(dev, clas);
243 ecore_device_subclass_set(dev, ECORE_DEVICE_SUBCLASS_NONE);
245 if (!edev->ecore_dev)
247 if (!edev->ecore_dev_list || (eina_list_count(edev->ecore_dev_list) == 0))
249 /* 1st Ecore_Device is added */
250 edev->ecore_dev = ecore_device_ref(dev);
254 /* 3rd or more Ecore_Device is added */
255 edev->ecore_dev_list = eina_list_append(edev->ecore_dev_list, ecore_device_ref(dev));
260 /* 2nd Ecore_Device is added */
261 edev->ecore_dev_list = eina_list_append(edev->ecore_dev_list, edev->ecore_dev);
262 edev->ecore_dev = NULL;
264 edev->ecore_dev_list = eina_list_append(edev->ecore_dev_list, ecore_device_ref(dev));
267 const GList *device_list = e_device_list_get();
268 const gchar *device_identifier;
269 for (GList *list = g_list_first((GList *)device_list); list; list = list->next)
271 E_Device *device = (E_Device *)list->data;
272 if (!device) continue;
273 device_identifier = e_device_identifier_get(device);
274 if (!device_identifier) continue;
276 if ((e_device_class_get(device) == clas) && (!strcmp(device_identifier, edev->path)))
285 // create E_Device info
286 e_dev = e_device_new();
289 ERR("Failed to add e device");
295 e_device_name_set(e_dev, libinput_device_get_name(edev->device));
296 e_device_identifier_set(e_dev, edev->path);
297 e_device_class_set(e_dev, clas);
298 e_device_subclass_set(e_dev, ECORE_DEVICE_SUBCLASS_NONE);
302 if (!edev->e_dev_list || (g_list_length(edev->e_dev_list) == 0))
304 /* 1st Ecore_Device is added */
305 edev->e_dev = g_object_ref(e_dev);
309 /* 3rd or more Ecore_Device is added */
310 edev->e_dev_list = g_list_append(edev->e_dev_list, g_object_ref(e_dev));
315 /* 2nd Ecore_Device is added */
316 edev->e_dev_list = g_list_append(edev->e_dev_list, edev->e_dev);
319 edev->e_dev_list = g_list_append(edev->e_dev_list, g_object_ref(e_dev));
322 _e_input_ecore_device_event(dev, edev->seat ? edev->seat->name : NULL, EINA_TRUE);
324 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));
330 _e_input_remove_ecore_device(E_Input_Evdev *edev, Ecore_Device_Class clas)
332 Eina_Bool ret = EINA_FALSE;
333 const Eina_List *dev_list = NULL, *l;
334 const GList *e_dev_list = NULL;
335 Eina_List *ll, *ll_next;
336 Ecore_Device *dev = NULL, *data;
337 const char *identifier;
338 const gchar *device_identifier;
339 const char *device_remove_log = NULL;
341 if (!edev->path) return EINA_FALSE;
343 dev_list = ecore_device_list();
344 if (!dev_list) return EINA_FALSE;
346 EINA_LIST_FOREACH(dev_list, l, dev)
349 identifier = ecore_device_identifier_get(dev);
350 if (!identifier) continue;
351 if ((ecore_device_class_get(dev) == clas) && (!strcmp(identifier, edev->path)))
355 ecore_device_unref(dev);
356 edev->ecore_dev = NULL;
358 else if (edev->ecore_dev_list)
360 EINA_LIST_FOREACH_SAFE(edev->ecore_dev_list, ll, ll_next, data)
364 ecore_device_unref(dev);
365 edev->ecore_dev_list = eina_list_remove_list(edev->ecore_dev_list, ll);
369 _e_input_ecore_device_event(dev, edev->seat ? edev->seat->name : NULL, EINA_FALSE);
370 ecore_device_del(dev);
375 e_dev_list = e_device_list_get();
378 ERR("Failed to get e device list");
382 for (GList *list = g_list_first((GList *)e_dev_list); list; list = list->next)
384 E_Device *device = (E_Device *)list->data;
385 if (!device) continue;
386 device_identifier = e_device_identifier_get(device);
387 if (!device_identifier) continue;
389 if ((e_device_class_get(device) == clas) && (!strcmp(device_identifier, edev->path)))
391 device_remove_log = eina_stringshare_printf("[Remove Device] device name(%s), identifier(%s), class(%s)",
392 e_device_name_get(device),
394 _e_input_ecore_device_class_to_string(clas));
398 g_object_unref(device);
401 else if (edev->e_dev_list)
403 GList *del_list = g_list_find(edev->e_dev_list, device);
406 edev->e_dev_list = g_list_delete_link(edev->e_dev_list, del_list);
413 if (device_remove_log)
415 INF("%s", device_remove_log);
416 eina_stringshare_del(device_remove_log);
423 _e_input_device_add(E_Input_Evdev *edev)
425 Eina_Bool ret = EINA_FALSE;
426 Ecore_Device_Class clas = ECORE_DEVICE_CLASS_NONE;
428 if (edev->caps & E_INPUT_SEAT_POINTER)
430 if (!e_devicemgr_detent_is_detent(libinput_device_get_name(edev->device)))
431 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_POINTER);
432 ret = _e_input_add_ecore_device(edev, clas);
434 if (edev->caps & E_INPUT_SEAT_KEYBOARD)
436 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_KEYBOARD);
437 ret = _e_input_add_ecore_device(edev, clas);
439 if (edev->caps & E_INPUT_SEAT_TOUCH)
441 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_TOUCH);
442 ret = _e_input_add_ecore_device(edev, clas);
449 _e_input_device_remove(E_Input_Evdev *edev)
451 Ecore_Device_Class clas = ECORE_DEVICE_CLASS_NONE;
454 if (edev->caps & E_INPUT_SEAT_POINTER)
456 if (!e_devicemgr_detent_is_detent(libinput_device_get_name(edev->device)))
457 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_POINTER);
458 _e_input_remove_ecore_device(edev, clas);
460 if (edev->caps & E_INPUT_SEAT_KEYBOARD)
462 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_KEYBOARD);
463 _e_input_remove_ecore_device(edev, clas);
465 if (edev->caps & E_INPUT_SEAT_TOUCH)
467 clas = _e_input_seat_cap_to_ecore_device_class(E_INPUT_SEAT_TOUCH);
468 _e_input_remove_ecore_device(edev, clas);
471 if (edev->ecore_dev_list)
473 if (eina_list_count(edev->ecore_dev_list) > 0)
475 EINA_LIST_FREE(edev->ecore_dev_list, data)
477 WRN("Invalid device is left. name: %s, identifier: %s, clas: %s\n",
478 ecore_device_name_get(data), ecore_device_identifier_get(data),
479 _e_input_ecore_device_class_to_string(ecore_device_class_get(data)));
481 ecore_device_unref(data);
482 ecore_device_del(data);
485 edev->ecore_dev_list = NULL;
490 _device_added(E_Input_Backend *input, struct libinput_device *device)
492 struct libinput_seat *libinput_seat;
493 const char *seat_name;
497 ecore_thread_main_loop_begin();
498 libinput_seat = libinput_device_get_seat(device);
499 seat_name = libinput_seat_get_logical_name(libinput_seat);
501 /* try to get a seat */
502 if (!(seat = _seat_get(input, seat_name)))
504 ERR("Could not get matching seat: %s", seat_name);
505 ecore_thread_main_loop_end();
509 /* try to create a new evdev device */
510 if (!(edev = _e_input_evdev_device_create(seat, device)))
512 ERR("Failed to create new evdev device");
513 ecore_thread_main_loop_end();
517 /* append this device to the seat */
518 seat->devices = eina_list_append(seat->devices, edev);
520 if (EINA_FALSE == _e_input_device_add(edev))
522 ERR("Failed to create evas device !\n");
523 ecore_thread_main_loop_end();
527 ecore_thread_main_loop_end();
531 _device_removed(E_Input_Backend *input, struct libinput_device *device)
535 ecore_thread_main_loop_begin();
537 /* try to get the evdev structure */
538 if (!(edev = libinput_device_get_user_data(device)))
540 ecore_thread_main_loop_end();
544 _e_input_device_remove(edev);
546 /* remove this evdev from the seat's list of devices */
547 edev->seat->devices = eina_list_remove(edev->seat->devices, edev);
549 /* destroy this evdev */
550 _e_input_evdev_device_destroy(edev);
552 ecore_thread_main_loop_end();
556 _udev_event_process(struct libinput_event *event)
558 struct libinput *libinput;
559 struct libinput_device *device;
560 E_Input_Backend *input;
561 Eina_Bool ret = EINA_TRUE;
563 libinput = libinput_event_get_context(event);
564 input = libinput_get_user_data(libinput);
565 device = libinput_event_get_device(event);
567 switch (libinput_event_get_type(event))
569 case LIBINPUT_EVENT_DEVICE_ADDED:
570 if (e_config->key_input_ttrace_enable)
572 TRACE_INPUT_BEGIN(_device_added);
573 ELOGF("INPUT", "_device_added|B|", NULL);
576 _device_added(input, device);
578 if (e_config->key_input_ttrace_enable)
581 ELOGF("INPUT", "_device_added|E|", NULL);
584 case LIBINPUT_EVENT_DEVICE_REMOVED:
585 if (e_config->key_input_ttrace_enable)
587 TRACE_INPUT_BEGIN(_device_removed);
588 ELOGF("INPUT", "_device_removed|B|", NULL);
591 _device_removed(input, device);
593 if (e_config->key_input_ttrace_enable)
596 ELOGF("INPUT", "_device_removed|E|", NULL);
607 _input_event_process(struct libinput_event *event)
609 if (_udev_event_process(event)) return;
610 if (_e_input_evdev_event_process(event)) return;
614 _input_events_process(E_Input_Backend *input)
616 struct libinput_event *event;
617 while ((event = libinput_get_event(input->libinput)))
619 _input_event_process(event);
620 libinput_event_destroy(event);
625 _cb_input_dispatch(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
627 E_Input_Backend *input;
629 if (!(input = data)) return EINA_TRUE;
631 if (e_config->key_input_ttrace_enable)
633 TRACE_INPUT_BEGIN(_cb_input_dispatch);
634 ELOGF("INPUT", "_cb_input_dispatch|B|", NULL);
637 if (libinput_dispatch(input->libinput) != 0)
638 ERR("Failed to dispatch libinput events: %m");
640 /* process pending events */
641 _input_events_process(input);
643 if (e_config->key_input_ttrace_enable)
646 ELOGF("INPUT", "_cb_input_dispatch|E|", NULL);
653 _e_input_delayed_key_events_print()
658 clock_gettime(CLOCK_MONOTONIC, &tp);
659 time = (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
661 GList *key_list = g_list_first(_key_event_list);
664 Ecore_Event_Key *key = (Ecore_Event_Key *)key_list->data;
667 if (e_config->key_input_time_limit <= (time - key->timestamp))
668 ERR("Delayed key event : keyname(%s), keycode(%u), timestamp(%u), elapsed_time(%u ms)", key->keyname, key->keycode, key->timestamp, time - key->timestamp);
671 eina_stringshare_del(key->keyname);
674 GList *next = key_list->next;
675 _key_event_list = g_list_delete_link(_key_event_list, key_list);
679 _key_event_list = NULL;
683 input_thread_prepare(GSource *source, gint *time)
685 if (e_config->key_input_ttrace_enable)
687 TRACE_INPUT_BEGIN(e_comp_wl_focused_client_flush);
688 ELOGF("INPUT", "e_comp_wl_focused_client_flush|B|", NULL);
691 /* flush only focused client events */
692 e_comp_wl_focused_client_flush();
695 _e_input_delayed_key_events_print();
697 if (e_config->key_input_ttrace_enable)
700 ELOGF("INPUT", "e_comp_wl_focused_client_flush|E|", NULL);
710 input_dispatch(GSource *source, GSourceFunc callback, gpointer user_data)
712 InputEventSource *src = (InputEventSource *)source;
713 E_Input_Backend *input = (E_Input_Backend *)user_data;
714 if (!src) return G_SOURCE_REMOVE;
715 if (!input) return G_SOURCE_REMOVE;
717 if (e_config->key_input_ttrace_enable)
719 TRACE_INPUT_BEGIN(input_dispatch);
720 ELOGF("INPUT", "input_dispatch|B|", NULL);
724 cond = g_source_query_unix_fd(source, src->tag);
726 if (cond & G_IO_ERR || cond & G_IO_HUP || cond & G_IO_NVAL)
728 INF("error cond(%d)\n", cond);
729 return G_SOURCE_CONTINUE;
732 if (!input->libinput)
733 return G_SOURCE_REMOVE;
735 if (e_config->key_input_ttrace_enable)
737 TRACE_INPUT_BEGIN(libinput_dispatch);
738 ELOGF("INPUT", "libinput_dispatch|B|", NULL);
741 if (libinput_dispatch(input->libinput) != 0)
742 ERR("Failed to dispatch libinput events: %m");
744 if (e_config->key_input_ttrace_enable)
747 ELOGF("INPUT", "libinput_dispatch|E|", NULL);
750 if (e_config->key_input_ttrace_enable)
752 TRACE_INPUT_BEGIN(_input_events_process);
753 ELOGF("INPUT", "_input_events_process|B|", NULL);
756 /* process pending events */
757 _input_events_process(input);
759 if (e_config->key_input_ttrace_enable)
762 ELOGF("INPUT", "_input_events_process|E|", NULL);
765 ELOGF("INPUT", "input_dispatch|E|", NULL);
768 e_input_event_process((GSource *)input->event_source);
770 return G_SOURCE_CONTINUE;
774 input_thread_start(void *data, Ecore_Thread *th)
777 E_Input_Backend *input;
778 GMainContext *context = NULL;
779 InputEventSource *input_event_source = NULL;
781 if (!(input = data)) return;
783 eina_thread_name_set(eina_thread_self(), "input-thread");
785 e_input_libinput_context_create(input);
787 /* enable this input */
788 if (!e_input_enable_input(input))
790 ERR("Failed to enable input");
794 /* append this input */
796 dev->inputs = eina_list_append(dev->inputs, input);
799 context = g_main_context_new();
800 g_main_context_push_thread_default(context);
802 input_event_source = (InputEventSource *)g_source_new(&input_event_funcs, sizeof(InputEventSource));
803 input_event_source->tag = g_source_add_unix_fd(&input_event_source->gsource, input->fd, G_IO_IN);
805 if (!input->event_source)
806 e_input_create_event_source(input);
809 input->input_thread_loop = g_main_loop_new(context, FALSE);
811 g_source_attach((GSource *)input->event_source, context);
813 //set the callback for this source
814 g_source_set_callback(&input_event_source->gsource, NULL, input, NULL);
815 g_source_attach(&input_event_source->gsource, context);
817 e_keyrouter_input_handler_add();
819 e_input_thread_id_set(gettid());
820 e_input_main_thread_id_set(getpid());
822 _e_input_hook_call(E_INPUT_HOOK_INPUT_THREAD_START, NULL);
824 INF("input thread start tid(%d) pid(%d)", e_input_thread_id_get(), e_input_main_thread_id_get());
826 g_main_loop_run(input->input_thread_loop);
830 input_thread_feedback(void *data, Ecore_Thread *th, void *msgdata)
832 E_Input_Backend *input;
834 INF("input thread start");
836 if (!(input = data)) return;
840 input_thread_end(void *data, Ecore_Thread *th)
842 E_Input_Backend *input;
844 if (!(input = data)) return;
845 INF("input thread complete");
847 e_input_event_source_destroy(input->event_source);
848 input->event_source = NULL;
850 g_main_loop_quit(input->input_thread_loop);
851 g_main_loop_unref(input->input_thread_loop);
852 input->input_thread_loop = NULL;
854 if (th == input->input_thread)
855 input->input_thread = NULL;
859 input_thread_cancel(void *data, Ecore_Thread *th)
861 E_Input_Backend *input;
863 if (!(input = data)) return;
865 INF("input thread cancel");
867 if (th == input->input_thread)
868 input->input_thread = NULL;
872 _e_input_key_event_list_add(Ecore_Event_Key *key)
874 Ecore_Event_Key *clone = NULL;
878 clone = E_NEW(Ecore_Event_Key, 1);
882 clone->keyname = (char *)eina_stringshare_add(key->keyname);
884 clone->keycode = key->keycode;
885 clone->timestamp = key->timestamp;
887 _key_event_list = g_list_append(_key_event_list, clone);
891 e_input_enable_input(E_Input_Backend *input)
893 EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
894 EINA_SAFETY_ON_NULL_RETURN_VAL(input->libinput, EINA_FALSE);
896 input->fd = libinput_get_fd(input->libinput);
898 if (!e_input_thread_mode_get())
903 ecore_main_fd_handler_add(input->fd, ECORE_FD_READ,
904 _cb_input_dispatch, input, NULL, NULL);
908 if (input->suspended)
910 if (libinput_resume(input->libinput) != 0)
913 input->suspended = EINA_FALSE;
915 /* process pending events */
916 _input_events_process(input);
919 input->enabled = EINA_TRUE;
920 input->suspended = EINA_FALSE;
925 input->enabled = EINA_FALSE;
926 if (!e_input_thread_mode_get())
929 ecore_main_fd_handler_del(input->hdlr);
937 e_input_disable_input(E_Input_Backend *input)
939 EINA_SAFETY_ON_NULL_RETURN(input);
940 EINA_SAFETY_ON_TRUE_RETURN(input->suspended);
942 /* suspend this input */
943 libinput_suspend(input->libinput);
945 /* process pending events */
946 _input_events_process(input);
948 input->suspended = EINA_TRUE;
950 if (e_input_thread_mode_get())
952 if (input->input_thread && !ecore_thread_check(input->input_thread))
953 ecore_thread_cancel(input->input_thread);
958 e_input_seat_evdev_list_get(E_Input_Seat *seat)
960 EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
961 return seat->devices;
964 E_API E_Input_Event_Source *
965 e_input_event_source_get()
967 return g_input_event_source;
971 e_input_thread_mode_get()
974 return e_config->input_thread_mode;
980 e_input_create_event_source(E_Input_Backend *input)
982 input->event_source = e_input_event_source_create();
984 g_input_event_source = input->event_source;
987 EINTERN void e_input_thread_run(E_Input_Backend *input)
989 input->input_thread = ecore_thread_feedback_run(input_thread_start, input_thread_feedback, input_thread_end, input_thread_cancel, input, EINA_FALSE);