}
EINTERN Eina_Bool
-e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *dev, uint32_t time)
+e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, void *dev, uint32_t time)
{
struct wl_resource *res;
struct wl_client *wc;
uint32_t serial, wl_keycode;
enum wl_keyboard_key_state state;
E_Comp_Config *comp_conf = NULL;
+ const char *dev_name = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res)
{
if (wl_resource_get_client(res) != wc) continue;
- if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
- else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_KEYBOARD, time);
+ if (!e_input_thread_mode_get())
+ {
+ if (dev)
+ {
+ _e_comp_wl_send_event_device(wc, time, (Ecore_Device *)dev, serial);
+ dev_name = ecore_device_name_get((Ecore_Device *)dev);
+ }
+ else
+ {
+ _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_KEYBOARD, time);
+ }
+ }
+ else
+ {
+ if (dev)
+ {
+ e_comp_wl_send_event_e_device(wc, time, (E_Device *)dev, serial);
+ dev_name = e_device_name_get(dev);
+ }
+ }
if (comp_conf && comp_conf->input_log_enable)
- ELOGF("Key", "Send Key %s (time: %d)", ec, (state ? "Down" : "Up"), time);
+ ELOGF("Key", "Send Key %s (keycode: %d, time: %d, device: %s)", ec, (state ? "Down" : "Up"), wl_keycode, time,
+ dev_name);
wl_keyboard_send_key(res, serial, time,
wl_keycode, state);
EINTERN void e_comp_wl_send_event_device(struct wl_client *wc, uint32_t timestamp, Ecore_Device *dev, uint32_t serial);
EINTERN void e_comp_wl_send_event_e_device(struct wl_client *wc, uint32_t timestamp, E_Device *dev, uint32_t serial);
-EINTERN Eina_Bool e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *dev, uint32_t time);
+EINTERN Eina_Bool e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, void *dev, uint32_t time);
EINTERN Eina_Bool e_comp_wl_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, uint32_t time);
EINTERN Eina_Bool e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, uint32_t time);
EINTERN Eina_Bool e_comp_wl_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, uint32_t time);
static void
_e_devicemgr_keyboard_grab_key_handler(uint32_t keycode, uint32_t state,
- uint32_t timestamp)
+ uint32_t timestamp, void *dev)
{
DMINF("key(%d-%s) event is delivered to grab ec(%p)",
keycode, state ? "Pressed" : "Released", e_devicemgr->keyboard_grab.ec);
if (!e_comp_wl_key_send(e_devicemgr->keyboard_grab.ec, keycode, state ? EINA_TRUE : EINA_FALSE,
- NULL, timestamp))
+ dev, timestamp))
{
DMERR("Could not send keyboard_grab_key to client(%p)", e_devicemgr->keyboard_grab.client);
}
typedef struct _E_Input_Coord E_Input_Coord;
typedef void (*e_input_relative_motion_cb)(double dx[2], double dy[2], uint64_t time_us);
-typedef void (*e_input_keyboard_grab_key_cb)(uint32_t keycode, uint32_t state, uint32_t timestamp);
+typedef void (*e_input_keyboard_grab_key_cb)(uint32_t keycode, uint32_t state, uint32_t timestamp, void *dev);
struct _E_Input
{
E_Comp_Config *comp_conf = NULL;
int *pressed_keycode = NULL, *idata = NULL;
Eina_Bool dup_found = EINA_FALSE;
- const char* device_name = NULL;
+ const char *device_name = NULL;
Ecore_Device_Subclass device_subclas = ECORE_DEVICE_SUBCLASS_NONE;
if (!(edev = libinput_device_get_user_data(device)))
{
if (e_devicemgr_keyboard_grab_subtype_is_grabbed(device_subclas))
{
- func(code, state, timestamp);
+ if (!e_input_thread_mode_get())
+ func(code, state, timestamp, ecore_dev);
+ else
+ func(code, state, timestamp, e_dev);
return;
}
}