summaryrefslogtreecommitdiff
path: root/apps/plugins/cube.c
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-12-18 21:13:15 +0100
committerChristian Soffke <christian.soffke@gmail.com>2022-12-29 04:39:22 +0100
commitfaa2cb99429214de745bbc3e64e48a7432db51ae (patch)
treede2967e0e8237cb86422cd82488e110b97ff831e /apps/plugins/cube.c
parent52f59f637dfcb24900b30ed52c1d7725eab93364 (diff)
downloadrockbox-faa2cb99429214de745bbc3e64e48a7432db51ae.tar.gz
rockbox-faa2cb99429214de745bbc3e64e48a7432db51ae.zip
plugins: Improve usability of iPod keymaps
- Reduce need to press multiple buttons at the same time to quit a plugin - Have "Menu" be default way to quit plugins or to access plugin menu - Fall back to (Long) "Select" or Long "Menu" in cases where Menu button isn't available (e.g. in ImageViewer and many games) out of scope: boomshine, lua_scripts, Rockpaint, Doom, Duke3D, Pacbox, Quake, Sgt-Puzzles, Wolf3D, XWorld, Minesweeper, Pixel Painter, Spacerocks Change-Id: I6d4dc7174695fe4b8ee9cbaccb21bdbfe6af5c48
Diffstat (limited to 'apps/plugins/cube.c')
-rw-r--r--apps/plugins/cube.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index dfd7df8951..43318f5aee 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -52,12 +52,14 @@
52#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ 52#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
53 (CONFIG_KEYPAD == IPOD_3G_PAD) || \ 53 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
54 (CONFIG_KEYPAD == IPOD_1G2G_PAD) 54 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
55#define CUBE_QUIT (BUTTON_SELECT | BUTTON_MENU) 55#define CUBE_QUIT_PRE BUTTON_MENU
56#define CUBE_QUIT (BUTTON_MENU | BUTTON_REL)
56#define CUBE_NEXT BUTTON_RIGHT 57#define CUBE_NEXT BUTTON_RIGHT
57#define CUBE_PREV BUTTON_LEFT 58#define CUBE_PREV BUTTON_LEFT
58#define CUBE_INC BUTTON_SCROLL_FWD 59#define CUBE_INC BUTTON_SCROLL_FWD
59#define CUBE_DEC BUTTON_SCROLL_BACK 60#define CUBE_DEC BUTTON_SCROLL_BACK
60#define CUBE_MODE BUTTON_MENU 61#define CUBE_MODE_PRE BUTTON_MENU
62#define CUBE_MODE (BUTTON_MENU | BUTTON_REPEAT)
61#define CUBE_PAUSE BUTTON_PLAY 63#define CUBE_PAUSE BUTTON_PLAY
62#define CUBE_HIGHSPEED_PRE BUTTON_SELECT 64#define CUBE_HIGHSPEED_PRE BUTTON_SELECT
63#define CUBE_HIGHSPEED (BUTTON_SELECT | BUTTON_REL) 65#define CUBE_HIGHSPEED (BUTTON_SELECT | BUTTON_REL)
@@ -729,6 +731,7 @@ enum plugin_status plugin_start(const void* parameter)
729 731
730 int button; 732 int button;
731#if defined(CUBE_MODE_PRE) || \ 733#if defined(CUBE_MODE_PRE) || \
734 defined(CUBE_QUIT_PRE) || \
732 defined(CUBE_PAUSE_PRE) || \ 735 defined(CUBE_PAUSE_PRE) || \
733 defined(CUBE_HIGHSPEED_PRE) 736 defined(CUBE_HIGHSPEED_PRE)
734 int lastbutton = BUTTON_NONE; 737 int lastbutton = BUTTON_NONE;
@@ -903,6 +906,10 @@ enum plugin_status plugin_start(const void* parameter)
903 case CUBE_RC_QUIT: 906 case CUBE_RC_QUIT:
904#endif 907#endif
905 case CUBE_QUIT: 908 case CUBE_QUIT:
909#ifdef CUBE_QUIT_PRE
910 if (lastbutton != CUBE_QUIT_PRE)
911 break;
912#endif
906 quit = true; 913 quit = true;
907 break; 914 break;
908 915
@@ -911,6 +918,7 @@ enum plugin_status plugin_start(const void* parameter)
911 break; 918 break;
912 } 919 }
913#if defined(CUBE_MODE_PRE) || \ 920#if defined(CUBE_MODE_PRE) || \
921 defined(CUBE_QUIT_PRE) || \
914 defined(CUBE_PAUSE_PRE) || \ 922 defined(CUBE_PAUSE_PRE) || \
915 defined(CUBE_HIGHSPEED_PRE) 923 defined(CUBE_HIGHSPEED_PRE)
916 if (button != BUTTON_NONE) 924 if (button != BUTTON_NONE)