e_input: add a option e_wheel_click_angle to increase wheel values 46/244146/2
authorjeon <jhyuni.kang@samsung.com>
Wed, 16 Sep 2020 03:19:13 +0000 (12:19 +0900)
committerjeon <jhyuni.kang@samsung.com>
Wed, 16 Sep 2020 03:19:15 +0000 (12:19 +0900)
Change-Id: Ie23c0cb766b29c475a74140783cb22199c34d704

src/bin/e_comp_cfdata.c
src/bin/e_comp_cfdata.h
src/bin/e_devicemgr_input.c
src/bin/e_input_evdev.c

index 00ff7c3..714eeb8 100644 (file)
@@ -93,6 +93,7 @@ e_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd)
    E_CONFIG_VAL(D, T, canvas_render_delay_after_boot, UCHAR);
    E_CONFIG_VAL(D, T, commit_handler_timer.use, UCHAR);
    E_CONFIG_VAL(D, T, commit_handler_timer.interval, DOUBLE);
+   E_CONFIG_VAL(D, T, e_wheel_click_angle, INT);
 }
 
 E_API E_Comp_Config *
@@ -261,6 +262,8 @@ e_comp_cfdata_config_new(void)
 
    cfg->canvas_render_delay_after_boot = 0;
 
+   cfg->e_wheel_click_angle = 1;
+
    return cfg;
 
 error:
index a484cc3..9d6f8ef 100644 (file)
@@ -80,6 +80,8 @@ struct _E_Comp_Config
       Eina_Bool use; // 0: none 1: use commit_handler timer
       double    interval; // time value the interval of commit_handler after tdm_commit in second (default : 0)
    } commit_handler_timer;
+
+   int e_wheel_click_angle;
 };
 
 struct _E_Comp_Match
index caf2204..5b9d07f 100644 (file)
@@ -339,6 +339,7 @@ _e_devicemgr_input_cb_mouse_wheel(void *data, int type, void *event)
    Ecore_Event_Mouse_Wheel *ev;
    int detent;
    Eina_Bool res = ECORE_CALLBACK_PASS_ON;
+   E_Comp_Config *comp_conf;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(event, res);
    ev = (Ecore_Event_Mouse_Wheel *)event;
@@ -349,6 +350,11 @@ _e_devicemgr_input_cb_mouse_wheel(void *data, int type, void *event)
      return ECORE_CALLBACK_PASS_ON;
 
    detent = ev->z;
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->e_wheel_click_angle)
+     {
+        detent = (int)(detent / comp_conf->e_wheel_click_angle);
+     }
 
    if (detent == 1 || detent == -1)
      {
index cf9937b..ade7f20 100644 (file)
@@ -987,6 +987,12 @@ _device_handle_axis(struct libinput_device *device, struct libinput_event_pointe
         z = libinput_event_pointer_get_axis_value_discrete(event, axis);
      }
 
+   comp_conf = e_comp_config_get();
+   if (comp_conf && comp_conf->e_wheel_click_angle)
+     {
+        z = (int)(z * comp_conf->e_wheel_click_angle);
+     }
+
    if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
        (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
      {
@@ -1024,7 +1030,6 @@ _device_handle_axis(struct libinput_device *device, struct libinput_event_pointe
    ev->z = z;
    ev->direction = direction;
 
-   comp_conf = e_comp_config_get();
    if (comp_conf && comp_conf->input_log_enable)
      {
         if (detent_data)