mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-11 14:15:15 -05:00
Gigabeat F/X:
Allow chaning of touchpad sensitivity in the System settings menu. Some units are dodgey at "Normal" senitivity and some at "High". "High" can make some units difficult to navigate and may even require a settings reset so try it and don't use "High" again if it doesn't work out :-). Defaults to "Normal" which behaves like older builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17656 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f76122f0e7
commit
c541e04632
8 changed files with 96 additions and 11 deletions
|
|
@ -11716,3 +11716,37 @@
|
||||||
recording: "Stop Recording And Shutdown"
|
recording: "Stop Recording And Shutdown"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
id: LANG_TOUCHPAD_SENSITIVITY
|
||||||
|
desc: touchpad sensitivity setting
|
||||||
|
user:
|
||||||
|
<source>
|
||||||
|
*: none
|
||||||
|
gigabeatf: "Touchpad Sensitivity"
|
||||||
|
</source>
|
||||||
|
<dest>
|
||||||
|
*: none
|
||||||
|
gigabeatf: "Touchpad Sensitivity"
|
||||||
|
</dest>
|
||||||
|
<voice>
|
||||||
|
*: none
|
||||||
|
gigabeatf: "Touchpad Sensitivity"
|
||||||
|
</voice>
|
||||||
|
</phrase>
|
||||||
|
<phrase>
|
||||||
|
id: LANG_HIGH
|
||||||
|
desc: in settings_menu
|
||||||
|
user:
|
||||||
|
<source>
|
||||||
|
*: none
|
||||||
|
gigabeatf: "High"
|
||||||
|
</source>
|
||||||
|
<dest>
|
||||||
|
*: none
|
||||||
|
gigabeatf: "High"
|
||||||
|
</dest>
|
||||||
|
<voice>
|
||||||
|
*: none
|
||||||
|
gigabeatf: "High"
|
||||||
|
</voice>
|
||||||
|
</phrase>
|
||||||
|
|
|
||||||
|
|
@ -361,6 +361,10 @@ MENUITEM_SETTING(buttonlight_timeout, &global_settings.buttonlight_timeout, NULL
|
||||||
MENUITEM_SETTING(buttonlight_brightness, &global_settings.buttonlight_brightness, NULL);
|
MENUITEM_SETTING(buttonlight_brightness, &global_settings.buttonlight_brightness, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
||||||
|
MENUITEM_SETTING(touchpad_sensitivity, &global_settings.touchpad_sensitivity, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
||||||
0, Icon_System_menu,
|
0, Icon_System_menu,
|
||||||
|
|
@ -399,6 +403,9 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
&keyclick_menu,
|
&keyclick_menu,
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
||||||
|
&touchpad_sensitivity,
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -929,6 +929,10 @@ void settings_apply(bool read_disk)
|
||||||
#endif
|
#endif
|
||||||
#endif /* HAVE_BACKLIGHT */
|
#endif /* HAVE_BACKLIGHT */
|
||||||
|
|
||||||
|
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
||||||
|
touchpad_set_sensitivity(global_settings.touchpad_sensitivity);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This should stay last */
|
/* This should stay last */
|
||||||
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
#if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC
|
||||||
enc_global_settings_apply();
|
enc_global_settings_apply();
|
||||||
|
|
|
||||||
|
|
@ -740,6 +740,9 @@ struct user_settings
|
||||||
unsigned char playlist_catalog_dir[MAX_FILENAME+1];
|
unsigned char playlist_catalog_dir[MAX_FILENAME+1];
|
||||||
bool study_mode; /* study mode enabled */
|
bool study_mode; /* study mode enabled */
|
||||||
int study_hop_step; /* hop step in study mode, in seconds */
|
int study_hop_step; /* hop step in study mode, in seconds */
|
||||||
|
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
||||||
|
int touchpad_sensitivity;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/** global variables **/
|
/** global variables **/
|
||||||
|
|
|
||||||
|
|
@ -1321,6 +1321,11 @@ const struct settings_list settings[] = {
|
||||||
#endif /* CONFIG_CODEC == SWCODEC */
|
#endif /* CONFIG_CODEC == SWCODEC */
|
||||||
FILENAME_SETTING(0, playlist_catalog_dir, "playlist catalog directory",
|
FILENAME_SETTING(0, playlist_catalog_dir, "playlist catalog directory",
|
||||||
PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL, MAX_FILENAME+1),
|
PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL, MAX_FILENAME+1),
|
||||||
|
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
||||||
|
CHOICE_SETTING(0, touchpad_sensitivity, LANG_TOUCHPAD_SENSITIVITY, 0,
|
||||||
|
"touchpad sensitivity", "normal,high", touchpad_set_sensitivity, 2,
|
||||||
|
ID2P(LANG_NORMAL), ID2P(LANG_HIGH)),
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,8 @@
|
||||||
/* We don't use a setting but a fixed delay after the backlight has
|
/* We don't use a setting but a fixed delay after the backlight has
|
||||||
* turned off */
|
* turned off */
|
||||||
#define LCD_SLEEP_TIMEOUT (5*HZ)
|
#define LCD_SLEEP_TIMEOUT (5*HZ)
|
||||||
|
|
||||||
|
#define HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
||||||
#endif /* BOOTLOADER */
|
#endif /* BOOTLOADER */
|
||||||
|
|
||||||
#define CONFIG_KEYPAD GIGABEAT_PAD
|
#define CONFIG_KEYPAD GIGABEAT_PAD
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,20 @@
|
||||||
static bool headphones_detect;
|
static bool headphones_detect;
|
||||||
static bool hold_button = false;
|
static bool hold_button = false;
|
||||||
|
|
||||||
|
#define TOUCHPAD_SENS_NORMAL ((1 << 12) | /* right++ */ \
|
||||||
|
(1 << 7) | /* left++ */ \
|
||||||
|
(1 << 6) | /* down++*/ \
|
||||||
|
(1 << 0) | /* up++ */ \
|
||||||
|
(1 << 3)) /* center */
|
||||||
|
|
||||||
|
#define TOUCHPAD_SENS_HIGH (((1 << 12) | (1 << 11)) | /* right++, right+ */ \
|
||||||
|
((1 << 8) | (1 << 7)) | /* left+, left++ */ \
|
||||||
|
((1 << 6) | (1 << 5)) | /* down++, down+ */ \
|
||||||
|
((1 << 1) | (1 << 0)) | /* up+, up++ */ \
|
||||||
|
(1 << 3)) /* Center */
|
||||||
|
|
||||||
|
static int touchpad_mask = TOUCHPAD_SENS_NORMAL;
|
||||||
|
|
||||||
static int const remote_buttons[] =
|
static int const remote_buttons[] =
|
||||||
{
|
{
|
||||||
BUTTON_NONE, /* Headphones connected - remote disconnected */
|
BUTTON_NONE, /* Headphones connected - remote disconnected */
|
||||||
|
|
@ -123,30 +137,31 @@ int button_read_device(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the touchpad - only watch the lines we actually read */
|
/* the touchpad - only watch the lines we actually read */
|
||||||
touchpad = GPJDAT & (((1 << 12) | (1 << 11)) | /* right++, right+ */
|
touchpad = GPJDAT & touchpad_mask;
|
||||||
((1 << 8) | (1 << 7)) | /* left+, left++ */
|
|
||||||
((1 << 6) | (1 << 5)) | /* down++, down+ */
|
|
||||||
((1 << 1) | (1 << 0)) | /* up+, up++ */
|
|
||||||
(1 << 3)); /* center */
|
|
||||||
if (touchpad)
|
if (touchpad)
|
||||||
{
|
{
|
||||||
if (touchpad & (1 << 3))
|
if (touchpad & (1 << 3))
|
||||||
{
|
{
|
||||||
btn |= BUTTON_SELECT;
|
btn |= BUTTON_SELECT;
|
||||||
/* Desensitize middle (+) detectors one level */
|
/* Desensitize all but outer detectors and still allow a combo if
|
||||||
touchpad &= ~((1 << 11) | (1 << 8) | (1 << 5) | (1 << 1));
|
* that's really intended. */
|
||||||
|
touchpad &= TOUCHPAD_SENS_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (touchpad & ((1 << 1) | (1 << 0)))
|
/* Simply include all lines in checks since "touchpad" has been
|
||||||
|
* masked to desired sensitivity already - allows any mask to be
|
||||||
|
* used without changing this code. */
|
||||||
|
if (touchpad & ((1 << 2) | (1 << 1) | (1 << 0)))
|
||||||
btn |= BUTTON_UP;
|
btn |= BUTTON_UP;
|
||||||
|
|
||||||
if (touchpad & ((1 << 12) | (1 << 11)))
|
if (touchpad & ((1 << 12) | (1 << 11) | (1 << 10)))
|
||||||
btn |= BUTTON_RIGHT;
|
btn |= BUTTON_RIGHT;
|
||||||
|
|
||||||
if (touchpad & ((1 << 6) | (1 << 5)))
|
if (touchpad & ((1 << 6) | (1 << 5) | (1 << 4)))
|
||||||
btn |= BUTTON_DOWN;
|
btn |= BUTTON_DOWN;
|
||||||
|
|
||||||
if (touchpad & ((1 << 8) | (1 << 7)))
|
if (touchpad & ((1 << 9) | (1 << 8) | (1 << 7)))
|
||||||
btn |= BUTTON_LEFT;
|
btn |= BUTTON_LEFT;
|
||||||
|
|
||||||
buttonlight_on();
|
buttonlight_on();
|
||||||
|
|
@ -155,6 +170,20 @@ int button_read_device(void)
|
||||||
return btn;
|
return btn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void touchpad_set_sensitivity(int level)
|
||||||
|
{
|
||||||
|
static const int masks[] =
|
||||||
|
{
|
||||||
|
TOUCHPAD_SENS_NORMAL,
|
||||||
|
TOUCHPAD_SENS_HIGH
|
||||||
|
};
|
||||||
|
|
||||||
|
if ((unsigned)level >= ARRAYLEN(masks))
|
||||||
|
level = 0;
|
||||||
|
|
||||||
|
touchpad_mask = masks[level];
|
||||||
|
}
|
||||||
|
|
||||||
bool headphones_inserted(void)
|
bool headphones_inserted(void)
|
||||||
{
|
{
|
||||||
return headphones_detect;
|
return headphones_detect;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
bool button_hold(void);
|
bool button_hold(void);
|
||||||
void button_init_device(void);
|
void button_init_device(void);
|
||||||
int button_read_device(void);
|
int button_read_device(void);
|
||||||
|
void touchpad_set_sensitivity(int level);
|
||||||
|
|
||||||
/* Toshiba Gigabeat specific button codes */
|
/* Toshiba Gigabeat specific button codes */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue