1
0
Fork 0
forked from len0rd/rockbox

Fuze+: add a configurable deadzone area for touchpad buttons

To stop erroneous button presses, allow users to add a deadzone between
the button via the Settings > General > System menu > Touch Dead Zone.

The configuration was chosen this way: the touchpad has the same DPI
in both direction so the setting applies the same on both the X and Y
axis. The setting ranges from 0 to 100 and is internally multiplied by 2
giving a maximum deadzone of 2*100 = 200 around each button, which
account for 400 total (once around each button), effectively reducing
each virtual button from 1000x600 to 600x200 when using the maximum value.

Change-Id: I8683c63d2950200eb32d1dda0a00bbd92d83d5be
Reviewed-on: http://gerrit.rockbox.org/677
Reviewed-by: Benjamin Brown <foolshperson@gmail.com>
Tested: Benjamin Brown <foolshperson@gmail.com>
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
This commit is contained in:
Amaury Pouly 2013-12-01 18:25:42 +00:00
parent 847106cdb2
commit 8146b40e73
10 changed files with 108 additions and 28 deletions

View file

@ -199,6 +199,10 @@ lineout_poweroff
touchscreen
#endif
#if defined(HAVE_TOUCHPAD_DEADZONE)
touchpad_deadzone
#endif
#if defined(HAVE_IMX233_CODEC) || defined(HAVE_WM8750) || defined(HAVE_WM8978)
depth_3d
#endif

View file

@ -10605,6 +10605,23 @@
gigabeatfx,sansafuzeplus: "Touchpad Sensitivity"
</voice>
</phrase>
<phrase>
id: LANG_DEADZONE
desc: touchpad deadzone setting
user: core
<source>
*: none
sansafuzeplus: "Touchpad Dead Zone"
</source>
<dest>
*: none
sansafuzeplus: "Touchpad Dead Zone"
</dest>
<voice>
*: none
sansafuzeplus: "Touchpad Dead Zone"
</voice>
</phrase>
<phrase>
id: LANG_HIGH
desc: in settings_menu

View file

@ -10692,6 +10692,23 @@
gigabeatfx,sansafuzeplus: "Touchpad Sensitivity"
</voice>
</phrase>
<phrase>
id: LANG_DEADZONE
desc: touchpad deadzone setting
user: core
<source>
*: none
sansafuzeplus: "Touchpad Dead Zone"
</source>
<dest>
*: none
sansafuzeplus: "Touchpad Dead Zone"
</dest>
<voice>
*: none
sansafuzeplus: "Touchpad Dead Zone"
</voice>
</phrase>
<phrase>
id: LANG_HIGH
desc: in settings_menu

View file

@ -317,6 +317,10 @@ MENUITEM_SETTING(buttonlight_brightness, &global_settings.buttonlight_brightness
MENUITEM_SETTING(touchpad_sensitivity, &global_settings.touchpad_sensitivity, NULL);
#endif
#ifdef HAVE_TOUCHPAD_DEADZONE
MENUITEM_SETTING(touchpad_deadzone, &global_settings.touchpad_deadzone, NULL);
#endif
#ifdef HAVE_QUICKSCREEN
MENUITEM_SETTING(shortcuts_replaces_quickscreen, &global_settings.shortcuts_replaces_qs, NULL);
#endif
@ -363,6 +367,9 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
&touchpad_sensitivity,
#endif
#ifdef HAVE_TOUCHPAD_DEADZONE
&touchpad_deadzone,
#endif
#ifdef USB_ENABLE_HID
&usb_hid,
&usb_keypad_mode,

View file

@ -1061,6 +1061,10 @@ void settings_apply(bool read_disk)
touchpad_set_sensitivity(global_settings.touchpad_sensitivity);
#endif
#ifdef HAVE_TOUCHPAD_DEADZONE
touchpad_set_deadzone(global_settings.touchpad_deadzone);
#endif
#ifdef HAVE_USB_CHARGING_ENABLE
usb_charging_enable(global_settings.usb_charging);
#endif

View file

@ -460,6 +460,10 @@ struct user_settings
int touchpad_sensitivity;
#endif
#ifdef HAVE_TOUCHPAD_DEADZONE
int touchpad_deadzone;
#endif
int pause_rewind; /* time in s to rewind when pausing */
#ifdef HAVE_HEADPHONE_DETECTION
int unplug_mode; /* pause on headphone unplug */

View file

@ -2024,6 +2024,14 @@ const struct settings_list settings[] = {
ID2P(LANG_NORMAL), ID2P(LANG_HIGH)),
#endif /* boolean or analogig values */
#endif /* HAVE_TOUCHPAD_SENSITIVITY_SETTING */
#ifdef HAVE_TOUCHPAD_DEADZONE
INT_SETTING(F_NO_WRAP, touchpad_deadzone, LANG_DEADZONE,
DEFAULT_TOUCHPAD_DEADZONE_SETTING, "touchpad deadzone", UNIT_INT,
MIN_TOUCHPAD_DEADSPACE_SETTING, MAX_TOUCHPAD_DEADSPACE_SETTING, 1,
NULL, NULL, touchpad_set_deadzone),
#endif
#ifdef HAVE_QUICKSCREEN
CUSTOM_SETTING(0, qs_items[QUICKSCREEN_TOP], LANG_TOP_QS_ITEM,
NULL, "qs top",