summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2006-09-10 12:06:54 +0000
committerBarry Wardell <rockbox@barrywardell.net>2006-09-10 12:06:54 +0000
commit2102dbf47e3a5c6ac51c8f8a45c3fbacd75ac928 (patch)
tree32d80b28ccfd0bce200bbeb6884ac93992b6f8f0 /apps
parente605786b2a737246e5813b5af1a910a0797f36de (diff)
downloadrockbox-2102dbf47e3a5c6ac51c8f8a45c3fbacd75ac928.tar.gz
rockbox-2102dbf47e3a5c6ac51c8f8a45c3fbacd75ac928.tar.bz2
rockbox-2102dbf47e3a5c6ac51c8f8a45c3fbacd75ac928.zip
New keymaps for H10. Makes the buttons much more intuitive and consistent. FS5962, FS5945, FS5940
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10918 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/keymaps/keymap-h10.c148
-rwxr-xr-xapps/plugins/bubbles.c19
2 files changed, 107 insertions, 60 deletions
diff --git a/apps/keymaps/keymap-h10.c b/apps/keymaps/keymap-h10.c
index c6b6229f61..2c7fec8d52 100644
--- a/apps/keymaps/keymap-h10.c
+++ b/apps/keymaps/keymap-h10.c
@@ -36,13 +36,18 @@ const struct button_mapping button_context_standard[] = {
{ ACTION_STD_PREVREPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_NEXT, BUTTON_SCROLL_DOWN, BUTTON_NONE },
{ ACTION_STD_NEXTREPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
+
+ { ACTION_STD_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
+ { ACTION_STD_CONTEXT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_STD_QUICKSCREEN, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_CONTEXT, BUTTON_FF, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_MENU, BUTTON_REW|BUTTON_REL, BUTTON_REW },
- { ACTION_STD_QUICKSCREEN, BUTTON_REW|BUTTON_REPEAT, BUTTON_REW },
- { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
+ /* TODO: this is a bit of a hack so that we can exit some debug screens
+ * (audio, tagcache, dircache, hwinfo, stack, ports). They don't like it
+ * when ACTION_STD_CANCEL has anything other than BUTTON_NONE for prereq.
+ */
+ { ACTION_STD_CANCEL, BUTTON_POWER|BUTTON_RIGHT, BUTTON_NONE },
LAST_ITEM_IN_LIST
}; /* button_context_standard */
@@ -63,9 +68,9 @@ const struct button_mapping button_context_wps[] = {
{ ACTION_WPS_VOLUP, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_WPS_BROWSE, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
+ { ACTION_WPS_CONTEXT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
{ ACTION_WPS_QUICKSCREEN, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_WPS_CONTEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_WPS_MENU, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
+ { ACTION_WPS_MENU, BUTTON_POWER, BUTTON_NONE },
{ ACTION_WPS_PITCHSCREEN, BUTTON_PLAY|BUTTON_LEFT, BUTTON_PLAY },
{ ACTION_WPS_ID3SCREEN, BUTTON_PLAY|BUTTON_RIGHT, BUTTON_PLAY },
@@ -78,30 +83,41 @@ const struct button_mapping button_context_settings[] = {
{ ACTION_SETTINGS_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE },
{ ACTION_SETTINGS_DECREPEAT,BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_RESET, BUTTON_PLAY, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
}; /* button_context_settings */
+const struct button_mapping button_context_list[] = {
+ { ACTION_LISTTREE_PGUP, BUTTON_REW|BUTTON_REL, BUTTON_REW },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_FF|BUTTON_REL, BUTTON_FF },
+
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
+}; /* button_context_list */
+
const struct button_mapping button_context_tree[] = {
- { ACTION_NONE, BUTTON_PLAY, BUTTON_NONE },
{ ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
{ ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
}; /* button_context_tree */
-const struct button_mapping button_context_tree_scroll_lr[] = {
- { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
- { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
+const struct button_mapping button_context_listtree_scroll_without_combo[] = {
+ { ACTION_TREE_PGLEFT, BUTTON_REW|BUTTON_REPEAT, BUTTON_REW },
+ { ACTION_TREE_PGRIGHT, BUTTON_FF|BUTTON_REPEAT, BUTTON_FF },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_tree_scroll_lr */
+}; /* button_context_listtree_scroll_without_combo */
+
+const struct button_mapping button_context_listtree_scroll_with_combo[] = {
+ { ACTION_LISTTREE_PGUP, BUTTON_REW|BUTTON_REPEAT, BUTTON_REW },
+ { ACTION_LISTTREE_PGDOWN, BUTTON_FF|BUTTON_REPEAT, BUTTON_FF },
+ { ACTION_TREE_PGLEFT, BUTTON_REW|BUTTON_PLAY, BUTTON_PLAY },
+ { ACTION_TREE_PGRIGHT, BUTTON_FF|BUTTON_PLAY, BUTTON_PLAY },
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
+}; /* button_context_listtree_scroll_with_combo */
const struct button_mapping button_context_yesno[] = {
{ ACTION_YESNO_ACCEPT, BUTTON_RIGHT, BUTTON_NONE },
@@ -113,48 +129,49 @@ const struct button_mapping button_context_quickscreen[] = {
{ ACTION_QS_DOWNINV, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_QS_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
{ ACTION_QS_DOWN, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_REW, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_FF, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_FF|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
}; /* button_context_quickscreen */
-const struct button_mapping button_context_settings_r_is_inc[] = {
- { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_PREV, BUTTON_SCROLL_UP, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_SCROLL_DOWN, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT,BUTTON_NONE },
- { ACTION_STD_OK, BUTTON_PLAY, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
+const struct button_mapping button_context_settings_right_is_inc[] = {
+ { ACTION_SETTINGS_INC, BUTTON_SCROLL_UP, BUTTON_NONE },
+ { ACTION_SETTINGS_INCREPEAT, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_SETTINGS_DEC, BUTTON_SCROLL_DOWN, BUTTON_NONE },
+ { ACTION_SETTINGS_DECREPEAT, BUTTON_SCROLL_DOWN|BUTTON_REPEAT,BUTTON_NONE },
+ { ACTION_STD_PREV, BUTTON_REW, BUTTON_NONE },
+ { ACTION_STD_PREVREPEAT, BUTTON_REW|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_STD_NEXT, BUTTON_FF, BUTTON_NONE },
+ { ACTION_STD_NEXTREPEAT, BUTTON_FF|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
+ { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings_r_is_inc */
+}; /* button_context_settings_right_is_inc */
const struct button_mapping button_context_pitchscreen[] = {
{ ACTION_PS_INC_SMALL, BUTTON_SCROLL_UP, BUTTON_NONE },
{ ACTION_PS_INC_BIG, BUTTON_SCROLL_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_PS_DEC_SMALL, BUTTON_SCROLL_DOWN, BUTTON_NONE },
{ ACTION_PS_DEC_BIG, BUTTON_SCROLL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
+ { ACTION_PS_NUDGE_LEFT, BUTTON_REW, BUTTON_NONE },
+ { ACTION_PS_NUDGE_LEFTOFF, BUTTON_REW|BUTTON_REL, BUTTON_NONE },
+ { ACTION_PS_NUDGE_RIGHT, BUTTON_FF, BUTTON_NONE },
+ { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_FF|BUTTON_REL, BUTTON_NONE },
{ ACTION_PS_RESET, BUTTON_PLAY, BUTTON_NONE },
- { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_PS_EXIT, BUTTON_LEFT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
}; /* button_context_pitchscreen */
const struct button_mapping button_context_keyboard[] = {
{ ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_KBD_SELECT, BUTTON_REW|BUTTON_REL, BUTTON_REW },
@@ -168,34 +185,47 @@ const struct button_mapping button_context_keyboard[] = {
LAST_ITEM_IN_LIST
}; /* button_context_keyboard */
+const struct button_mapping button_context_bmark[] = {
+ { ACTION_BMS_DELETE, BUTTON_REW, BUTTON_NONE },
+ { ACTION_BMS_SELECT, BUTTON_RIGHT, BUTTON_NONE },
+ { ACTION_BMS_EXIT, BUTTON_LEFT, BUTTON_NONE },
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
+}; /* button_context_bmark */
+
/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
const struct button_mapping* get_context_mapping(int context)
{
switch (context)
{
- case CONTEXT_STD:
+ case CONTEXT_STD:
+ case CONTEXT_MAINMENU:
return button_context_standard;
case CONTEXT_WPS:
return button_context_wps;
- case CONTEXT_SETTINGS_EQ:
- case CONTEXT_SETTINGS_TIME:
- case CONTEXT_SETTINGS_COLOURCHOOSER:
- case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
- return button_context_settings_r_is_inc;
- case CONTEXT_SETTINGS:
- return button_context_settings;
-
- case CONTEXT_YESNOSCREEN:
- return button_context_yesno;
-
+ case CONTEXT_LIST:
+ return button_context_list;
case CONTEXT_TREE:
if (global_settings.hold_lr_for_scroll_in_list)
- return button_context_tree_scroll_lr;
- /* else fall through to CUSTOM|1 */
+ return button_context_listtree_scroll_without_combo;
+ else
+ return button_context_listtree_scroll_with_combo;
case CONTEXT_CUSTOM|CONTEXT_TREE:
return button_context_tree;
+
+ case CONTEXT_SETTINGS:
+ return button_context_settings;
+ case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
+ case CONTEXT_SETTINGS_COLOURCHOOSER:
+ case CONTEXT_SETTINGS_EQ:
+ case CONTEXT_SETTINGS_TIME:
+ return button_context_settings_right_is_inc;
+
+ case CONTEXT_YESNOSCREEN:
+ return button_context_yesno;
+ case CONTEXT_BOOKMARKSCREEN:
+ return button_context_bmark;
case CONTEXT_QUICKSCREEN:
return button_context_quickscreen;
case CONTEXT_PITCHSCREEN:
@@ -203,8 +233,6 @@ const struct button_mapping* get_context_mapping(int context)
case CONTEXT_KEYBOARD:
return button_context_keyboard;
- case CONTEXT_LIST:
- case CONTEXT_MAINMENU:
default:
return button_context_standard;
}
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index f47889b08b..be3783cdc9 100755
--- a/apps/plugins/bubbles.c
+++ b/apps/plugins/bubbles.c
@@ -2398,6 +2398,9 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock,
break;
case BUBBLES_SELECT: /* fire the shot */
+#if CONFIG_KEYPAD == IRIVER_H10_PAD
+ case BUBBLES_UP: /* easier to press on H10 */
+#endif
if(!animblock) {
bb->elapsedlvl += bb->elapsedshot;
bb->elapsedshot = 0;
@@ -2519,6 +2522,22 @@ static int bubbles(struct game_context* bb) {
"OFF to exit, "
"UP to fire and show high scores, "
"LEFT/RIGHT to aim and to change level.");
+#elif CONFIG_KEYPAD == IRIVER_H10_PAD
+#define BUBBLES_LEFT BUTTON_LEFT
+#define BUBBLES_RIGHT BUTTON_RIGHT
+#define BUBBLES_UP BUTTON_SCROLL_UP
+#define BUBBLES_DOWN BUTTON_SCROLL_DOWN
+#define BUBBLES_QUIT BUTTON_POWER
+#define BUBBLES_START BUTTON_PLAY
+#define BUBBLES_SELECT BUTTON_REW
+#define BUBBLES_RESUME BUTTON_FF
+ rb->lcd_puts(0, 2, "PLAY to start/pause");
+ rb->lcd_puts(0, 3, "FF to save/resume");
+ rb->lcd_puts(0, 4, "POWER to exit");
+ rb->lcd_puts(0, 5, "REW/UP to fire");
+ rb->lcd_puts(0, 6, " and show high scores");
+ rb->lcd_puts(0, 7, "LEFT/RIGHT to aim");
+ rb->lcd_puts(0, 8, "UP/DOWN to change level");
#endif
#if LCD_WIDTH >= 138
rb->snprintf(str, 28, "Start on level %d of %d", startlevel+1,