e_input: add logs to get input event info from kernel 85/214785/4
authorjeon <jhyuni.kang@samsung.com>
Thu, 26 Sep 2019 08:34:38 +0000 (17:34 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Mon, 30 Sep 2019 03:10:23 +0000 (03:10 +0000)
Change-Id: I3fe249827d2e254a5e30bc264a999da194ffe5b0

src/bin/e_input_evdev.c

index 9b38eb1..eb2030b 100644 (file)
@@ -371,6 +371,7 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
    E_Keyrouter_Event_Data *key_data;
    Ecore_Device *ecore_dev = NULL, *data;
    Eina_List *l;
+   E_Comp_Config *comp_conf = NULL;
 
    if (!(edev = libinput_device_get_user_data(device)))
      {
@@ -499,6 +500,10 @@ _device_handle_key(struct libinput_device *device, struct libinput_event_keyboar
    e->modifiers = edev->xkb.modifiers;
    e->dev = ecore_device_ref(ecore_dev);
 
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->input_log_enable)
+     ELOGF("Key", "%s (keyname: %s, keycode: %d, device: %s)", NULL, state?"Press":"Release", e->keyname, e->keycode, ecore_device_name_get(e->dev));
+
    if (state)
      ecore_event_add(ECORE_EVENT_KEY_DOWN, e, _e_input_event_key_cb_free, NULL);
    else
@@ -686,6 +691,7 @@ _device_handle_button(struct libinput_device *device, struct libinput_event_poin
    uint32_t button, timestamp;
    Ecore_Device *ecore_dev = NULL, *detent_data = NULL, *data;
    Eina_List *l;
+   E_Comp_Config *comp_conf = NULL;
 
    if (!(edev = libinput_device_get_user_data(device)))
      {
@@ -802,6 +808,10 @@ _device_handle_button(struct libinput_device *device, struct libinput_event_poin
    if (edev->mouse.did_triple)
      ev->triple_click = 1;
 
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->input_log_enable)
+     ELOGF("Mouse", "Button %s (btn: %d, device: %s)", NULL, state?"Press":"Release", button, ecore_device_name_get(ev->dev));
+
    if (state)
      ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, _e_input_event_mouse_button_cb_free, NULL);
    else
@@ -1100,6 +1110,7 @@ _device_handle_touch_down(struct libinput_device *device, struct libinput_event_
 {
    E_Input_Evdev *edev;
    int w = 0, h = 0;
+   E_Comp_Config *comp_conf = NULL;
 
    if (!(edev = libinput_device_get_user_data(device)))
      {
@@ -1121,6 +1132,10 @@ _device_handle_touch_down(struct libinput_device *device, struct libinput_event_
         edev->touch.coords[edev->mt_slot].y = edev->seat->ptr.iy;
      }
 
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->input_log_enable)
+     ELOGF("Touch", "Down (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+
    _device_handle_touch_motion_send(edev, event);
    _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_DOWN);
 }
@@ -1167,6 +1182,7 @@ static void
 _device_handle_touch_up(struct libinput_device *device, struct libinput_event_touch *event)
 {
    E_Input_Evdev *edev;
+   E_Comp_Config *comp_conf = NULL;
 
    if (!(edev = libinput_device_get_user_data(device)))
      {
@@ -1183,6 +1199,10 @@ _device_handle_touch_up(struct libinput_device *device, struct libinput_event_to
           edev->touch.coords[edev->mt_slot].y;
      }
 
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->input_log_enable)
+     ELOGF("Touch", "Up (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
+
    _device_handle_touch_event_send(edev, event, ECORE_EVENT_MOUSE_BUTTON_UP);
 }