diff --git a/data/desktop_gnome_peripherals_touchpad.schemas.in b/data/desktop_gnome_peripherals_touchpad.schemas.in index 381dc24..9ce2cb0 100644 --- a/data/desktop_gnome_peripherals_touchpad.schemas.in +++ b/data/desktop_gnome_peripherals_touchpad.schemas.in @@ -27,6 +27,42 @@ + /schemas/desktop/gnome/peripherals/touchpad/tap_button_1 + /desktop/gnome/peripherals/touchpad/tap_button_1 + gnome + int + 1 + + Button assigned to one finger tap + Set this to the button number that you want to click by tapping one finger. + + + + + /schemas/desktop/gnome/peripherals/touchpad/tap_button_2 + /desktop/gnome/peripherals/touchpad/tap_button_2 + gnome + int + 3 + + Button assigned to two finger tap + Set this to the button number that you want to click by tapping two fingers. + + + + + /schemas/desktop/gnome/peripherals/touchpad/tap_button_3 + /desktop/gnome/peripherals/touchpad/tap_button_3 + gnome + int + 2 + + Button assigned to three finger tap + Set this to the button number that you want to click by tapping three fingers. + + + + /schemas/desktop/gnome/peripherals/touchpad/scroll_method /desktop/gnome/peripherals/touchpad/scroll_method gnome diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c index 4c463eb..0909e4d 100644 --- a/plugins/mouse/gsd-mouse-manager.c +++ b/plugins/mouse/gsd-mouse-manager.c @@ -64,6 +64,9 @@ #define KEY_DELAY_ENABLE GCONF_MOUSE_A11Y_DIR "/delay_enable" #define KEY_TOUCHPAD_DISABLE_W_TYPING GCONF_TOUCHPAD_DIR "/disable_while_typing" #define KEY_TAP_TO_CLICK GCONF_TOUCHPAD_DIR "/tap_to_click" +#define KEY_TAP_BUTTON_1 GCONF_TOUCHPAD_DIR "/tap_button_1" +#define KEY_TAP_BUTTON_2 GCONF_TOUCHPAD_DIR "/tap_button_2" +#define KEY_TAP_BUTTON_3 GCONF_TOUCHPAD_DIR "/tap_button_3" #define KEY_SCROLL_METHOD GCONF_TOUCHPAD_DIR "/scroll_method" #define KEY_PAD_HORIZ_SCROLL GCONF_TOUCHPAD_DIR "/horiz_scroll_enabled" @@ -540,7 +543,7 @@ set_disable_w_typing (GsdMouseManager *manager, gboolean state) } static int -set_tap_to_click (gboolean state) +set_tap_to_click (gboolean state, guint tapButton1, guint tapButton2, guint tapButton3) { int numdevices, i, format, rc; unsigned long nitems, bytes_after; @@ -567,9 +570,9 @@ set_tap_to_click (gboolean state) if (rc == Success && type == XA_INTEGER && format == 8 && nitems >= 7) { /* Set RLM mapping for 1/2/3 fingers*/ - data[4] = (state) ? 1 : 0; - data[5] = (state) ? 3 : 0; - data[6] = (state) ? 2 : 0; + data[4] = (state) ? tapButton1 : 0; + data[5] = (state) ? tapButton2 : 0; + data[6] = (state) ? tapButton3 : 0; XChangeDeviceProperty (GDK_DISPLAY (), device, prop, XA_INTEGER, 8, PropModeReplace, data, nitems); } @@ -818,7 +821,10 @@ set_mouse_settings (GsdMouseManager *manager) set_motion_threshold (manager, gconf_client_get_int (client, KEY_MOTION_THRESHOLD, NULL)); set_disable_w_typing (manager, gconf_client_get_bool (client, KEY_TOUCHPAD_DISABLE_W_TYPING, NULL)); - set_tap_to_click (gconf_client_get_bool (client, KEY_TAP_TO_CLICK, NULL)); + set_tap_to_click (gconf_client_get_bool (client, KEY_TAP_TO_CLICK, NULL), + gconf_client_get_int (client, KEY_TAP_BUTTON_1, NULL), + gconf_client_get_int (client, KEY_TAP_BUTTON_2, NULL), + gconf_client_get_int (client, KEY_TAP_BUTTON_3, NULL)); set_edge_scroll (gconf_client_get_int (client, KEY_SCROLL_METHOD, NULL)); set_horiz_scroll (gconf_client_get_bool (client, KEY_PAD_HORIZ_SCROLL, NULL)); @@ -846,9 +852,14 @@ mouse_callback (GConfClient *client, } else if (! strcmp (entry->key, KEY_TOUCHPAD_DISABLE_W_TYPING)) { if (entry->value->type == GCONF_VALUE_BOOL) set_disable_w_typing (manager, gconf_value_get_bool (entry->value)); - } else if (! strcmp (entry->key, KEY_TAP_TO_CLICK)) { - if (entry->value->type == GCONF_VALUE_BOOL) - set_tap_to_click (gconf_value_get_bool (entry->value)); + } else if (! strcmp (entry->key, KEY_TAP_TO_CLICK) && entry->value->type == GCONF_VALUE_BOOL + || ! strcmp (entry->key, KEY_TAP_BUTTON_1) && entry->value->type == GCONF_VALUE_INT + || ! strcmp (entry->key, KEY_TAP_BUTTON_2) && entry->value->type == GCONF_VALUE_INT + || ! strcmp (entry->key, KEY_TAP_BUTTON_3) && entry->value->type == GCONF_VALUE_INT) { + set_tap_to_click (gconf_client_get_bool (client, KEY_TAP_TO_CLICK, NULL), + gconf_client_get_int (client, KEY_TAP_BUTTON_1, NULL), + gconf_client_get_int (client, KEY_TAP_BUTTON_2, NULL), + gconf_client_get_int (client, KEY_TAP_BUTTON_3, NULL)); } else if (! strcmp (entry->key, KEY_SCROLL_METHOD)) { if (entry->value->type == GCONF_VALUE_INT) { set_edge_scroll (gconf_value_get_int (entry->value)); @@ -928,7 +939,10 @@ gsd_mouse_manager_idle_cb (GsdMouseManager *manager) gconf_client_get_bool (client, KEY_DELAY_ENABLE, NULL)); set_disable_w_typing (manager, gconf_client_get_bool (client, KEY_TOUCHPAD_DISABLE_W_TYPING, NULL)); - set_tap_to_click (gconf_client_get_bool (client, KEY_TAP_TO_CLICK, NULL)); + set_tap_to_click (gconf_client_get_bool (client, KEY_TAP_TO_CLICK, NULL), + gconf_client_get_int (client, KEY_TAP_BUTTON_1, NULL), + gconf_client_get_int (client, KEY_TAP_BUTTON_2, NULL), + gconf_client_get_int (client, KEY_TAP_BUTTON_3, NULL)); set_edge_scroll (gconf_client_get_int (client, KEY_SCROLL_METHOD, NULL)); set_horiz_scroll (gconf_client_get_bool (client, KEY_PAD_HORIZ_SCROLL, NULL));