summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-12-01 18:25:42 +0000
committerAmaury Pouly <amaury.pouly@gmail.com>2014-09-08 11:21:54 +0200
commit8146b40e73bb999001787fbf414c96acf5dce2a8 (patch)
treee3a1b2f951fd439c71d82e387d04df10d926b4e9 /apps
parent847106cdb20a0297dc9a10f212f0e3c8e6f3d58c (diff)
downloadrockbox-8146b40e73bb999001787fbf414c96acf5dce2a8.tar.gz
rockbox-8146b40e73bb999001787fbf414c96acf5dce2a8.tar.bz2
rockbox-8146b40e73bb999001787fbf414c96acf5dce2a8.zip
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>
Diffstat (limited to 'apps')
-rw-r--r--apps/features.txt4
-rw-r--r--apps/lang/english-us.lang17
-rw-r--r--apps/lang/english.lang17
-rw-r--r--apps/menus/settings_menu.c7
-rw-r--r--apps/settings.c4
-rw-r--r--apps/settings.h4
-rw-r--r--apps/settings_list.c8
7 files changed, 61 insertions, 0 deletions
diff --git a/apps/features.txt b/apps/features.txt
index 63f023458f..d9ca1a3ece 100644
--- a/apps/features.txt
+++ b/apps/features.txt
@@ -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
diff --git a/apps/lang/english-us.lang b/apps/lang/english-us.lang
index a6549dafd5..4a316cedca 100644
--- a/apps/lang/english-us.lang
+++ b/apps/lang/english-us.lang
@@ -10606,6 +10606,23 @@
</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
user: core
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 9914b160f1..113570522c 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -10693,6 +10693,23 @@
</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
user: core
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 0d2a7febf1..130f5be1a2 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -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,
diff --git a/apps/settings.c b/apps/settings.c
index 819924a421..515e7cb5f3 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -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
diff --git a/apps/settings.h b/apps/settings.h
index 60658f6857..3ec5ee6207 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -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 */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 53acb78d98..cddc062d40 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -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",