conf_interaction: Support tap-to-click with pointer device

Summary:
Allow to setup tap-to-click feature with libinput pointer device.

@feature

Reviewers: devilhorns, zmike

Reviewed By: devilhorns

Subscribers: cedric, zmike

Tags: #enlightenment-git

Differential Revision: https://phab.enlightenment.org/D7845
This commit is contained in:
Michaël Bouchaud (yoz) 2019-01-31 09:10:57 -05:00 committed by Christopher Michael
parent 91770e35f8
commit 3ab092a61c
5 changed files with 12 additions and 0 deletions

View File

@ -651,6 +651,7 @@ _e_config_edd_init(Eina_Bool old)
E_CONFIG_VAL(D, T, mouse_accel_numerator, INT);
E_CONFIG_VAL(D, T, mouse_accel_denominator, INT);
E_CONFIG_VAL(D, T, mouse_accel_threshold, INT);
E_CONFIG_VAL(D, T, touch_tap_to_click, UCHAR);
E_CONFIG_VAL(D, T, border_raise_on_mouse_action, INT);
E_CONFIG_VAL(D, T, border_raise_on_focus, INT);
@ -1732,6 +1733,7 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->mouse_accel_numerator, 1, 30);
E_CONFIG_LIMIT(e_config->mouse_accel_denominator, 1, 10);
E_CONFIG_LIMIT(e_config->mouse_accel_threshold, 0, 10);
E_CONFIG_LIMIT(e_config->touch_tap_to_click, 0, 3);
E_CONFIG_LIMIT(e_config->menu_favorites_show, 0, 1);
E_CONFIG_LIMIT(e_config->menu_apps_show, 0, 1);

View File

@ -255,6 +255,7 @@ struct _E_Config
int mouse_accel_numerator; // GUI
int mouse_accel_denominator; // GUI
int mouse_accel_threshold; // GUI
unsigned char touch_tap_to_click; // GUI
int border_raise_on_mouse_action; // GUI
int border_raise_on_focus; // GUI

View File

@ -55,6 +55,7 @@ e_mouse_update(void)
{
ecore_drm2_device_pointer_left_handed_set(dev, (Eina_Bool)!e_config->mouse_hand);
ecore_drm2_device_pointer_accel_speed_set(dev, e_config->mouse_accel_numerator);
ecore_drm2_device_touch_tap_to_click_enabled_set(dev, e_config->touch_tap_to_click);
}
}
#endif

View File

@ -24,6 +24,7 @@ struct _E_Config_Dialog_Data
double numerator;
double denominator;
double threshold;
int tap_to_click;
};
E_Config_Dialog *
@ -61,6 +62,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->numerator = e_config->mouse_accel_numerator;
cfdata->denominator = e_config->mouse_accel_denominator;
cfdata->threshold = e_config->mouse_accel_threshold;
cfdata->tap_to_click = e_config->touch_tap_to_click;
}
static void *
@ -83,6 +85,7 @@ _basic_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfd
(cfdata->use_e_cursor == e_config->use_e_cursor) &&
(cfdata->cursor_size == e_config->cursor_size) &&
(cfdata->mouse_hand == e_config->mouse_hand) &&
(cfdata->tap_to_click == e_config->touch_tap_to_click) &&
EINA_DBL_EQ(cfdata->numerator, e_config->mouse_accel_numerator) &&
EINA_DBL_EQ(cfdata->denominator, e_config->mouse_accel_denominator) &&
EINA_DBL_EQ(cfdata->threshold, e_config->mouse_accel_threshold));
@ -108,6 +111,7 @@ _basic_apply_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata
e_config->mouse_accel_numerator = cfdata->numerator;
e_config->mouse_accel_denominator = cfdata->denominator;
e_config->mouse_accel_threshold = cfdata->threshold;
e_config->touch_tap_to_click = cfdata->tap_to_click;
e_config_save_queue();
/* Apply the above settings */
@ -230,6 +234,9 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dia
&(cfdata->threshold), NULL, 100);
e_widget_framelist_object_append(of, ob);
oc = e_widget_check_add(evas, _("Tap to click"), &(cfdata->tap_to_click));
e_widget_framelist_object_append(of, oc);
e_widget_list_object_append(ol, of, 1, 0, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Mouse"), ol,
1, 0, 1, 0, 0.5, 0.0);

View File

@ -713,6 +713,7 @@ _drm2_cb_seat_caps(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
}
else if (ev->pointer_count > 0)
{
e_mouse_update();
e_comp_wl_input_pointer_enabled_set(EINA_TRUE);
e_pointer_show(e_comp->pointer);
}