diff --git a/apps/keymaps/keymap-fuzeplus.c b/apps/keymaps/keymap-fuzeplus.c index 8a2cd9c3c8..0a4db76f03 100644 --- a/apps/keymaps/keymap-fuzeplus.c +++ b/apps/keymaps/keymap-fuzeplus.c @@ -39,7 +39,7 @@ static const struct button_mapping button_context_standard[] = { { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, { 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 }, @@ -57,7 +57,6 @@ static const struct button_mapping button_context_standard[] = { { ACTION_TREE_STOP, BUTTON_PLAYPAUSE|BUTTON_REPEAT, 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 }; /* 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_PGDOWN, BUTTON_BOTTOMRIGHT, BUTTON_NONE }, { 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 }, -#endif +#endif*/ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) }; /* 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_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_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_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_QUICKSCREEN, BUTTON_BOTTOMLEFT|BUTTON_REL, BUTTON_BOTTOMLEFT }, { ACTION_WPS_ID3SCREEN, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT }, diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c index 0250d276d9..a723ce89ba 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c +++ b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c @@ -200,8 +200,6 @@ static struct button_area_t button_areas[] = #define RMI_INTERRUPT 1 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 const char rmi_thread_name[] = "rmi"; 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 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) - { - case 2: - /* enter two fingers mode */ - 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; - } + if(nr_fingers == 1) + touchpad_btns = find_button(absolute_x, absolute_y); + else + touchpad_btns = 0; /* enable interrupt */ imx233_setup_pin_irq(0, 27, true, true, false, &rmi_attn_cb); diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/button-target.h b/firmware/target/arm/imx233/sansa-fuzeplus/button-target.h index 2e5e6c157c..1536dbe1ab 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/button-target.h +++ b/firmware/target/arm/imx233/sansa-fuzeplus/button-target.h @@ -42,13 +42,12 @@ bool button_debug_screen(void); #define BUTTON_BACK 0x00000200 #define BUTTON_BOTTOMLEFT 0x00000400 #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| \ BUTTON_UP|BUTTON_RIGHT|BUTTON_DOWN|BUTTON_SELECT| \ BUTTON_PLAYPAUSE|BUTTON_BACK| \ - BUTTON_TWO_FINGERS|BUTTON_BOTTOMRIGHT|BUTTON_BOTTOMLEFT) + BUTTON_BOTTOMRIGHT|BUTTON_BOTTOMLEFT) #define BUTTON_REMOTE 0