forked from len0rd/rockbox
fuze+: remove two_finger pseudo touchpad button because it was unrealiable, update keymap to remove akward mappings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31444 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4fe6963e40
commit
84b97dd1ea
3 changed files with 10 additions and 49 deletions
|
@ -39,7 +39,7 @@ static const struct button_mapping button_context_standard[] = {
|
||||||
{ ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
{ ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
|
||||||
{ ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
|
{ ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
|
||||||
{ ACTION_STD_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
|
{ ACTION_STD_CANCEL, BUTTON_BACK, BUTTON_NONE },
|
||||||
{ ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
|
{ ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,7 +57,6 @@ static const struct button_mapping button_context_standard[] = {
|
||||||
{ ACTION_TREE_STOP, BUTTON_PLAYPAUSE|BUTTON_REPEAT, BUTTON_NONE },
|
{ ACTION_TREE_STOP, BUTTON_PLAYPAUSE|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
|
||||||
{ ACTION_STD_KEYLOCK, BUTTON_POWER, BUTTON_NONE },
|
{ ACTION_STD_KEYLOCK, BUTTON_POWER, BUTTON_NONE },
|
||||||
{ ACTION_STD_KEYLOCK, BUTTON_TWO_FINGERS|BUTTON_REL, BUTTON_TWO_FINGERS|BUTTON_REPEAT },
|
|
||||||
|
|
||||||
LAST_ITEM_IN_LIST
|
LAST_ITEM_IN_LIST
|
||||||
}; /* button_context_standard */
|
}; /* button_context_standard */
|
||||||
|
@ -69,9 +68,9 @@ static const struct button_mapping button_context_list[] = {
|
||||||
{ ACTION_LISTTREE_PGUP, BUTTON_BOTTOMLEFT|BUTTON_REPEAT, BUTTON_BOTTOMLEFT },
|
{ ACTION_LISTTREE_PGUP, BUTTON_BOTTOMLEFT|BUTTON_REPEAT, BUTTON_BOTTOMLEFT },
|
||||||
{ ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT, BUTTON_NONE },
|
{ ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT, BUTTON_NONE },
|
||||||
{ ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT },
|
{ ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT },
|
||||||
#ifdef HAVE_HOTKEY
|
/*#ifdef HAVE_HOTKEY on some gesture later?
|
||||||
{ ACTION_TREE_HOTKEY, BUTTON_BACK|BUTTON_REL, BUTTON_BACK|BUTTON_REPEAT },
|
{ ACTION_TREE_HOTKEY, BUTTON_BACK|BUTTON_REL, BUTTON_BACK|BUTTON_REPEAT },
|
||||||
#endif
|
#endif*/
|
||||||
|
|
||||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||||
}; /* button_context_list */
|
}; /* button_context_list */
|
||||||
|
@ -80,7 +79,7 @@ static const struct button_mapping button_context_wps[] = {
|
||||||
{ ACTION_WPS_PLAY, BUTTON_PLAYPAUSE|BUTTON_REL, BUTTON_PLAYPAUSE },
|
{ ACTION_WPS_PLAY, BUTTON_PLAYPAUSE|BUTTON_REL, BUTTON_PLAYPAUSE },
|
||||||
{ ACTION_WPS_STOP, BUTTON_PLAYPAUSE|BUTTON_REPEAT, BUTTON_NONE },
|
{ ACTION_WPS_STOP, BUTTON_PLAYPAUSE|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
|
||||||
{ ACTION_WPS_MENU, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
|
{ ACTION_WPS_MENU, BUTTON_BACK, BUTTON_NONE },
|
||||||
|
|
||||||
{ ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
|
{ ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
|
||||||
{ ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE },
|
{ ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE },
|
||||||
|
@ -102,7 +101,6 @@ static const struct button_mapping button_context_wps[] = {
|
||||||
{ ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
|
{ ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
|
||||||
{ ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
|
{ ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
|
||||||
|
|
||||||
{ ACTION_WPS_REC, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK },
|
|
||||||
{ ACTION_WPS_PITCHSCREEN, BUTTON_BOTTOMLEFT|BUTTON_REPEAT, BUTTON_BOTTOMLEFT },
|
{ ACTION_WPS_PITCHSCREEN, BUTTON_BOTTOMLEFT|BUTTON_REPEAT, BUTTON_BOTTOMLEFT },
|
||||||
{ ACTION_WPS_QUICKSCREEN, BUTTON_BOTTOMLEFT|BUTTON_REL, BUTTON_BOTTOMLEFT },
|
{ ACTION_WPS_QUICKSCREEN, BUTTON_BOTTOMLEFT|BUTTON_REL, BUTTON_BOTTOMLEFT },
|
||||||
{ ACTION_WPS_ID3SCREEN, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT },
|
{ ACTION_WPS_ID3SCREEN, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT },
|
||||||
|
|
|
@ -200,8 +200,6 @@ static struct button_area_t button_areas[] =
|
||||||
#define RMI_INTERRUPT 1
|
#define RMI_INTERRUPT 1
|
||||||
|
|
||||||
static int touchpad_btns = 0;
|
static int touchpad_btns = 0;
|
||||||
static bool two_fingers_mode = 0;
|
|
||||||
static int button_delay = 0;
|
|
||||||
static long rmi_stack [DEFAULT_STACK_SIZE/sizeof(long)];
|
static long rmi_stack [DEFAULT_STACK_SIZE/sizeof(long)];
|
||||||
static const char rmi_thread_name[] = "rmi";
|
static const char rmi_thread_name[] = "rmi";
|
||||||
static struct event_queue rmi_queue;
|
static struct event_queue rmi_queue;
|
||||||
|
@ -265,45 +263,11 @@ static void rmi_thread(void)
|
||||||
int absolute_y = u.s.absolute.y_msb << 8 | u.s.absolute.y_lsb;
|
int absolute_y = u.s.absolute.y_msb << 8 | u.s.absolute.y_lsb;
|
||||||
int nr_fingers = u.s.absolute.misc & 7;
|
int nr_fingers = u.s.absolute.misc & 7;
|
||||||
|
|
||||||
/* Handle the single vs two fingers event considering the following issues:
|
|
||||||
- When they are two fingers on the touchpad the signal often
|
|
||||||
switch between 1 and 2 fingers. We use the bool
|
|
||||||
two_fingers_mode to "lock" the two fingers's signal
|
|
||||||
as long as the user doesn't release the touchpad
|
|
||||||
- User can hit the device at first with only one finger while
|
|
||||||
trying to do a double fingers's touch. In order to "smooth"
|
|
||||||
the signal, we set a delay on single finger so that user as
|
|
||||||
time to actually touch with 2 finger if he meant to.
|
|
||||||
*/
|
|
||||||
|
|
||||||
switch(nr_fingers)
|
if(nr_fingers == 1)
|
||||||
{
|
touchpad_btns = find_button(absolute_x, absolute_y);
|
||||||
case 2:
|
else
|
||||||
/* enter two fingers mode */
|
touchpad_btns = 0;
|
||||||
two_fingers_mode = 1;
|
|
||||||
touchpad_btns = BUTTON_TWO_FINGERS;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
/* Ignore any touch when in two fingers mode */
|
|
||||||
if (two_fingers_mode)
|
|
||||||
touchpad_btns = BUTTON_TWO_FINGERS;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(button_delay > 2)
|
|
||||||
touchpad_btns = find_button(absolute_x, absolute_y);
|
|
||||||
else
|
|
||||||
button_delay++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
/* reset two fingers mode and delay */
|
|
||||||
two_fingers_mode = 0;
|
|
||||||
button_delay = 0;
|
|
||||||
touchpad_btns = 0;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* enable interrupt */
|
/* enable interrupt */
|
||||||
imx233_setup_pin_irq(0, 27, true, true, false, &rmi_attn_cb);
|
imx233_setup_pin_irq(0, 27, true, true, false, &rmi_attn_cb);
|
||||||
|
|
|
@ -42,13 +42,12 @@ bool button_debug_screen(void);
|
||||||
#define BUTTON_BACK 0x00000200
|
#define BUTTON_BACK 0x00000200
|
||||||
#define BUTTON_BOTTOMLEFT 0x00000400
|
#define BUTTON_BOTTOMLEFT 0x00000400
|
||||||
#define BUTTON_BOTTOMRIGHT 0x00000800
|
#define BUTTON_BOTTOMRIGHT 0x00000800
|
||||||
/* Touch the touchpad with two fingers */
|
|
||||||
#define BUTTON_TWO_FINGERS 0x000001000
|
|
||||||
|
|
||||||
#define BUTTON_MAIN (BUTTON_VOL_UP|BUTTON_VOL_DOWN|BUTTON_POWER|BUTTON_LEFT| \
|
#define BUTTON_MAIN (BUTTON_VOL_UP|BUTTON_VOL_DOWN|BUTTON_POWER|BUTTON_LEFT| \
|
||||||
BUTTON_UP|BUTTON_RIGHT|BUTTON_DOWN|BUTTON_SELECT| \
|
BUTTON_UP|BUTTON_RIGHT|BUTTON_DOWN|BUTTON_SELECT| \
|
||||||
BUTTON_PLAYPAUSE|BUTTON_BACK| \
|
BUTTON_PLAYPAUSE|BUTTON_BACK| \
|
||||||
BUTTON_TWO_FINGERS|BUTTON_BOTTOMRIGHT|BUTTON_BOTTOMLEFT)
|
BUTTON_BOTTOMRIGHT|BUTTON_BOTTOMLEFT)
|
||||||
|
|
||||||
#define BUTTON_REMOTE 0
|
#define BUTTON_REMOTE 0
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue