diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 88a0302278..bf15f0ba65 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -1,6 +1,3 @@ -/* Temporarily disable the plugins for the iPod until we fix the - button assignments and other problems */ -#if (CONFIG_KEYPAD!=IPOD_4G_PAD) && (CONFIG_KEYPAD!=IPOD_NANO_PAD) /* plugins common to all models */ battery_test.c chessclock.c @@ -89,4 +86,3 @@ midi2wav.c splitedit.c metronome.c #endif -#endif /* PP5020 */ diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c index 31ae801934..87d60c85a5 100644 --- a/apps/plugins/battery_test.c +++ b/apps/plugins/battery_test.c @@ -39,6 +39,8 @@ #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) #define BATTERY_TEST_QUIT BUTTON_OFF +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define BATTERY_TEST_QUIT BUTTON_MENU #endif static struct plugin_api* rb; diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c index 487965a4cf..ed2f9337b2 100644 --- a/apps/plugins/bounce.c +++ b/apps/plugins/bounce.c @@ -32,17 +32,30 @@ /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD +#define BOUNCE_UP BUTTON_UP +#define BOUNCE_DOWN BUTTON_DOWN #define BOUNCE_QUIT (BUTTON_OFF | BUTTON_REL) #define BOUNCE_MODE (BUTTON_ON | BUTTON_REL) #elif CONFIG_KEYPAD == ONDIO_PAD +#define BOUNCE_UP BUTTON_UP +#define BOUNCE_DOWN BUTTON_DOWN #define BOUNCE_QUIT (BUTTON_OFF | BUTTON_REL) #define BOUNCE_MODE (BUTTON_MENU | BUTTON_REL) #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) +#define BOUNCE_UP BUTTON_UP +#define BOUNCE_DOWN BUTTON_DOWN #define BOUNCE_QUIT (BUTTON_OFF | BUTTON_REL) #define BOUNCE_MODE (BUTTON_SELECT | BUTTON_REL) + +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define BOUNCE_UP BUTTON_SCROLL_BACK +#define BOUNCE_DOWN BUTTON_SCROLL_FWD +#define BOUNCE_QUIT (BUTTON_MENU | BUTTON_REL) +#define BOUNCE_MODE (BUTTON_SELECT | BUTTON_REL) + #endif static struct plugin_api* rb; @@ -396,11 +409,11 @@ static int loopit(void) case BUTTON_RIGHT: values[show].num++; break; - case BUTTON_UP: + case BOUNCE_UP: if(++show == NUM_LAST) show=0; break; - case BUTTON_DOWN: + case BOUNCE_DOWN: if(--show < 0) show=NUM_LAST-1; break; diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c index e9de760b22..70104391d6 100644 --- a/apps/plugins/calculator.c +++ b/apps/plugins/calculator.c @@ -106,6 +106,8 @@ F3: equal to "=" /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD +#define CALCULATOR_UP BUTTON_UP +#define CALCULATOR_DOWN BUTTON_DOWN #define CALCULATOR_QUIT BUTTON_OFF #define CALCULATOR_INPUT BUTTON_PLAY #define CALCULATOR_CALC BUTTON_F3 @@ -113,6 +115,8 @@ F3: equal to "=" #define CALCULATOR_CLEAR BUTTON_F1 #elif CONFIG_KEYPAD == ONDIO_PAD +#define CALCULATOR_UP BUTTON_UP +#define CALCULATOR_DOWN BUTTON_DOWN #define CALCULATOR_QUIT BUTTON_OFF #define CALCULATOR_INPUT_CALC_PRE BUTTON_MENU #define CALCULATOR_INPUT (BUTTON_MENU | BUTTON_REL) @@ -120,12 +124,23 @@ F3: equal to "=" #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) +#define CALCULATOR_UP BUTTON_UP +#define CALCULATOR_DOWN BUTTON_DOWN #define CALCULATOR_QUIT BUTTON_OFF #define CALCULATOR_INPUT BUTTON_SELECT #define CALCULATOR_CALC BUTTON_ON #define CALCULATOR_OPERATORS BUTTON_MODE #define CALCULATOR_CLEAR BUTTON_REC +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) + +#define CALCULATOR_UP BUTTON_SCROLL_BACK +#define CALCULATOR_DOWN BUTTON_SCROLL_FWD +#define CALCULATOR_QUIT BUTTON_MENU +#define CALCULATOR_INPUT_CALC_PRE BUTTON_SELECT +#define CALCULATOR_INPUT (BUTTON_SELECT | BUTTON_REL) +#define CALCULATOR_CALC (BUTTON_PLAY | BUTTON_REPEAT) + #endif static struct plugin_api* rb; @@ -675,16 +690,16 @@ void moveButton(void){ n++; break; - case BUTTON_UP: - case BUTTON_UP | BUTTON_REPEAT: + case CALCULATOR_UP: + case CALCULATOR_UP | BUTTON_REPEAT: if (m == 0) m = 4; else m--; break; - case BUTTON_DOWN: - case BUTTON_DOWN | BUTTON_REPEAT: + case CALCULATOR_DOWN: + case CALCULATOR_DOWN | BUTTON_REPEAT: if (m == 4) m = 0; else @@ -1359,10 +1374,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) case BUTTON_LEFT | BUTTON_REPEAT: case BUTTON_RIGHT: case BUTTON_RIGHT | BUTTON_REPEAT: - case BUTTON_UP: - case BUTTON_UP | BUTTON_REPEAT: - case BUTTON_DOWN: - case BUTTON_DOWN | BUTTON_REPEAT: + case CALCULATOR_UP: + case CALCULATOR_UP | BUTTON_REPEAT: + case CALCULATOR_DOWN: + case CALCULATOR_DOWN | BUTTON_REPEAT: moveButton(); break; case CALCULATOR_QUIT: diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c index 0f5c03d71d..b53980f9e4 100644 --- a/apps/plugins/chessclock.c +++ b/apps/plugins/chessclock.c @@ -64,6 +64,16 @@ #define CHC_SETTINGS_CANCEL BUTTON_OFF #define CHC_SETTINGS_CANCEL2 BUTTON_REC +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define CHC_QUIT BUTTON_PLAY +#define CHC_STARTSTOP BUTTON_SELECT +#define CHC_RESET BUTTON_LEFT +#define CHC_MENU BUTTON_MENU +#define CHC_SETTINGS_INC BUTTON_SCROLL_FWD +#define CHC_SETTINGS_DEC BUTTON_SCROLL_BACK +#define CHC_SETTINGS_OK BUTTON_SELECT +#define CHC_SETTINGS_CANCEL BUTTON_MENU + #endif diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c index a92fc4d13c..295ac35dc3 100644 --- a/apps/plugins/chip8.c +++ b/apps/plugins/chip8.c @@ -946,6 +946,7 @@ STATIC void chip8 (void) /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD /* only 9 out of 16 chip8 buttons */ +#define CHIP8_OFF BUTTON_OFF #define CHIP8_KEY1 BUTTON_F1 #define CHIP8_KEY2 BUTTON_UP #define CHIP8_KEY3 BUTTON_F3 @@ -957,6 +958,7 @@ STATIC void chip8 (void) #define CHIP8_KEY9 BUTTON_ON #elif CONFIG_KEYPAD == ONDIO_PAD /* even more limited */ +#define CHIP8_OFF BUTTON_OFF #define CHIP8_KEY2 BUTTON_UP #define CHIP8_KEY4 BUTTON_LEFT #define CHIP8_KEY5 BUTTON_MENU @@ -965,12 +967,21 @@ STATIC void chip8 (void) #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) +#define CHIP8_OFF BUTTON_OFF #define CHIP8_KEY2 BUTTON_UP #define CHIP8_KEY4 BUTTON_LEFT #define CHIP8_KEY5 BUTTON_SELECT #define CHIP8_KEY6 BUTTON_RIGHT #define CHIP8_KEY8 BUTTON_DOWN +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define CHIP8_OFF BUTTON_MENU +#define CHIP8_KEY2 BUTTON_SCROLL_BACK +#define CHIP8_KEY4 BUTTON_LEFT +#define CHIP8_KEY5 BUTTON_PLAY +#define CHIP8_KEY6 BUTTON_RIGHT +#define CHIP8_KEY8 BUTTON_SCROLL_FWD + #endif static byte chip8_virtual_keys[16]; @@ -1076,7 +1087,7 @@ static void chip8_keyboard(void) int button = rb->button_get(false); switch (button) { - case BUTTON_OFF: /* Abort Emulator */ + case CHIP8_OFF: /* Abort Emulator */ chip8_running = 0; break; diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index dc5b5706f4..f081f88e4a 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -79,6 +79,19 @@ #define CUBE_PAUSE (BUTTON_ON | BUTTON_REL) #define CUBE_HIGHSPEED BUTTON_SELECT +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define CUBE_QUIT BUTTON_MENU +#define CUBE_X_INC BUTTON_LEFT +#define CUBE_X_DEC BUTTON_RIGHT +#define CUBE_Y_INC BUTTON_SCROLL_FWD +#define CUBE_Y_DEC BUTTON_SCROLL_BACK +#define CUBE_Z_INC (BUTTON_SELECT | BUTTON_LEFT) +#define CUBE_Z_DEC (BUTTON_SELECT | BUTTON_RIGHT) +#define CUBE_MODE (BUTTON_SELECT | BUTTON_MENU) +#define CUBE_PAUSE_PRE BUTTON_PLAY +#define CUBE_PAUSE (BUTTON_PLAY | BUTTON_REL) +#define CUBE_HIGHSPEED (BUTTON_SELECT | BUTTON_PLAY) + #endif #ifdef HAVE_LCD_BITMAP diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c index 9a8027f2ca..67674b099d 100644 --- a/apps/plugins/demystify.c +++ b/apps/plugins/demystify.c @@ -24,12 +24,19 @@ #ifdef HAVE_LCD_BITMAP /* Key assignement */ +#if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define DEMYSTIFY_QUIT BUTTON_MENU +#define DEMYSTIFY_ADD_POLYGON BUTTON_RIGHT +#define DEMYSTIFY_REMOVE_POLYGON BUTTON_LEFT +#define DEMYSTIFY_INCREASE_SPEED BUTTON_SCROLL_FWD +#define DEMYSTIFY_DECREASE_SPEED BUTTON_SCROLL_BACK +#else #define DEMYSTIFY_QUIT BUTTON_OFF #define DEMYSTIFY_ADD_POLYGON BUTTON_UP #define DEMYSTIFY_REMOVE_POLYGON BUTTON_DOWN #define DEMYSTIFY_INCREASE_SPEED BUTTON_RIGHT #define DEMYSTIFY_DECREASE_SPEED BUTTON_LEFT - +#endif #define DEFAULT_WAIT_TIME 3 #define DEFAULT_NB_POLYGONS 7 diff --git a/apps/plugins/dict.c b/apps/plugins/dict.c index 441f7400b3..a80ace2871 100644 --- a/apps/plugins/dict.c +++ b/apps/plugins/dict.c @@ -102,6 +102,8 @@ long reverse (long N) { /* Button definitions */ #if CONFIG_KEYPAD == PLAYER_PAD #define LP_QUIT BUTTON_STOP +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define LP_QUIT BUTTON_MENU #else #define LP_QUIT BUTTON_OFF #endif diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index 36411c2978..da449d397c 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c @@ -21,6 +21,8 @@ /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD +#define FLIPIT_UP BUTTON_UP +#define FLIPIT_DOWN BUTTON_DOWN #define FLIPIT_QUIT BUTTON_OFF #define FLIPIT_SHUFFLE BUTTON_F1 #define FLIPIT_SOLVE BUTTON_F2 @@ -28,6 +30,8 @@ #define FLIPIT_TOGGLE BUTTON_PLAY #elif CONFIG_KEYPAD == ONDIO_PAD +#define FLIPIT_UP BUTTON_UP +#define FLIPIT_DOWN BUTTON_DOWN #define FLIPIT_QUIT BUTTON_OFF #define FLIPIT_SHUFFLE (BUTTON_MENU | BUTTON_LEFT) #define FLIPIT_SOLVE (BUTTON_MENU | BUTTON_UP) @@ -37,6 +41,8 @@ #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) +#define FLIPIT_UP BUTTON_UP +#define FLIPIT_DOWN BUTTON_DOWN #define FLIPIT_QUIT BUTTON_OFF #define FLIPIT_SHUFFLE BUTTON_MODE #define FLIPIT_SOLVE BUTTON_ON @@ -44,6 +50,17 @@ #define FLIPIT_TOGGLE_PRE BUTTON_SELECT #define FLIPIT_TOGGLE (BUTTON_SELECT | BUTTON_REL) +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) + +#define FLIPIT_UP BUTTON_SCROLL_FWD +#define FLIPIT_DOWN BUTTON_SCROLL_BACK +#define FLIPIT_QUIT BUTTON_MENU +#define FLIPIT_SHUFFLE (BUTTON_SELECT | BUTTON_LEFT) +#define FLIPIT_SOLVE (BUTTON_SELECT | BUTTON_PLAY) +#define FLIPIT_STEP_BY_STEP (BUTTON_SELECT | BUTTON_MENU) +#define FLIPIT_TOGGLE_PRE BUTTON_SELECT +#define FLIPIT_TOGGLE (BUTTON_SELECT | BUTTON_REL) + #endif static struct plugin_api* rb; @@ -252,12 +269,12 @@ static bool flipit_loop(void) { move_cursor(1, 0); break; - case BUTTON_UP: + case FLIPIT_UP: if ((cursor_pos/5)>0) move_cursor(0, -1); break; - case BUTTON_DOWN: + case FLIPIT_DOWN: if ((cursor_pos/5)<3) move_cursor(0, 1); break; diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 39d77324de..84bb306ed1 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -50,12 +50,16 @@ static unsigned jewel_color[8]={COLOR_BLACK, COLOR_RED, COLOR_ORANGE, /* button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD +#define BEJEWELED_UP BUTTON_UP +#define BEJEWELED_DOWN BUTTON_DOWN #define BEJEWELED_QUIT BUTTON_OFF #define BEJEWELED_START BUTTON_ON #define BEJEWELED_SELECT BUTTON_PLAY #define BEJEWELED_RESUME BUTTON_F1 #elif CONFIG_KEYPAD == ONDIO_PAD +#define BEJEWELED_UP BUTTON_UP +#define BEJEWELED_DOWN BUTTON_DOWN #define BEJEWELED_QUIT BUTTON_OFF #define BEJEWELED_START BUTTON_RIGHT #define BEJEWELED_SELECT (BUTTON_MENU|BUTTON_REL) @@ -63,11 +67,21 @@ static unsigned jewel_color[8]={COLOR_BLACK, COLOR_RED, COLOR_ORANGE, #define BEJEWELED_RESUME (BUTTON_MENU|BUTTON_OFF) #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) +#define BEJEWELED_UP BUTTON_UP +#define BEJEWELED_DOWN BUTTON_DOWN #define BEJEWELED_QUIT BUTTON_OFF #define BEJEWELED_START BUTTON_ON #define BEJEWELED_SELECT BUTTON_SELECT #define BEJEWELED_RESUME BUTTON_MODE +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define BEJEWELED_UP BUTTON_SCROLL_BACK +#define BEJEWELED_DOWN BUTTON_SCROLL_FWD +#define BEJEWELED_QUIT BUTTON_MENU +#define BEJEWELED_START BUTTON_PLAY +#define BEJEWELED_SELECT BUTTON_SELECT +#define BEJEWELED_RESUME (BUTTON_SELECT | BUTTON_PLAY) + #else #error BEJEWELED: Unsupported keypad #endif @@ -1081,8 +1095,8 @@ static int bejeweled(struct game_context* bj) { } break; - case BUTTON_DOWN: /* move cursor down */ - case (BUTTON_DOWN|BUTTON_REPEAT): + case BEJEWELED_DOWN: /* move cursor down */ + case (BEJEWELED_DOWN|BUTTON_REPEAT): if(selected) { bj->score += bejeweled_swapjewels(bj, x, y, SWAP_DOWN); selected = false; @@ -1092,8 +1106,8 @@ static int bejeweled(struct game_context* bj) { } break; - case BUTTON_UP: /* move cursor up */ - case (BUTTON_UP|BUTTON_REPEAT): + case BEJEWELED_UP: /* move cursor up */ + case (BEJEWELED_UP|BUTTON_REPEAT): if(selected) { bj->score += bejeweled_swapjewels(bj, x, y, SWAP_UP); selected = false; diff --git a/apps/plugins/logo.c b/apps/plugins/logo.c index baaf46f911..40f131861a 100644 --- a/apps/plugins/logo.c +++ b/apps/plugins/logo.c @@ -181,6 +181,12 @@ const unsigned char rockbox16x7[] = { #define LP_INC_X BUTTON_RIGHT #define LP_DEC_Y (BUTTON_ON | BUTTON_LEFT) #define LP_INC_Y (BUTTON_ON | BUTTON_RIGHT) +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define LP_QUIT BUTTON_MENU +#define LP_DEC_X BUTTON_LEFT +#define LP_INC_X BUTTON_RIGHT +#define LP_DEC_Y BUTTON_SCROLL_BACK +#define LP_INC_Y BUTTON_SCROLL_FWD #else #define LP_QUIT BUTTON_OFF #define LP_DEC_X BUTTON_LEFT diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index 4af467b516..ea278df59c 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -41,6 +41,8 @@ use F3 to see how many mines are left (supposing all your flags are correct) /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD +#define MINESWP_UP BUTTON_UP +#define MINESWP_DOWN BUTTON_DOWN #define MINESWP_QUIT BUTTON_OFF #define MINESWP_START BUTTON_ON #define MINESWP_TOGGLE BUTTON_PLAY @@ -50,6 +52,8 @@ use F3 to see how many mines are left (supposing all your flags are correct) #define MINESWP_INFO BUTTON_F3 #elif CONFIG_KEYPAD == ONDIO_PAD +#define MINESWP_UP BUTTON_UP +#define MINESWP_DOWN BUTTON_DOWN #define MINESWP_QUIT BUTTON_OFF #define MINESWP_START BUTTON_MENU #define MINESWP_TOGGLE_PRE BUTTON_MENU @@ -59,12 +63,23 @@ use F3 to see how many mines are left (supposing all your flags are correct) #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) +#define MINESWP_UP BUTTON_UP +#define MINESWP_DOWN BUTTON_DOWN #define MINESWP_QUIT BUTTON_OFF #define MINESWP_START BUTTON_SELECT #define MINESWP_TOGGLE BUTTON_SELECT #define MINESWP_DISCOVER BUTTON_ON #define MINESWP_INFO BUTTON_MODE +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define MINESWP_UP BUTTON_SCROLL_BACK +#define MINESWP_DOWN BUTTON_SCROLL_FWD +#define MINESWP_QUIT BUTTON_MENU +#define MINESWP_START BUTTON_SELECT +#define MINESWP_TOGGLE BUTTON_PLAY +#define MINESWP_DISCOVER (BUTTON_SELECT | BUTTON_PLAY) +#define MINESWP_INFO (BUTTON_SELECT | BUTTON_MENU) + #endif /* here is a global api struct pointer. while not strictly necessary, @@ -323,11 +338,11 @@ int minesweeper(void) button = rb->button_get(true); switch(button){ - case BUTTON_DOWN: + case MINESWP_DOWN: p = (p + 98)%100; break; - case BUTTON_UP: + case MINESWP_UP: p = (p + 2)%100; break; @@ -431,14 +446,14 @@ int minesweeper(void) break; /* move cursor down */ - case BUTTON_DOWN: - case (BUTTON_DOWN | BUTTON_REPEAT): + case MINESWP_DOWN: + case (MINESWP_DOWN | BUTTON_REPEAT): y = (y + 1)%height; break; /* move cursor up */ - case BUTTON_UP: - case (BUTTON_UP | BUTTON_REPEAT): + case MINESWP_UP: + case (MINESWP_UP | BUTTON_REPEAT): y = (y + height - 1)%height; break; diff --git a/apps/plugins/mosaique.c b/apps/plugins/mosaique.c index 75bd155338..a05d1656c8 100644 --- a/apps/plugins/mosaique.c +++ b/apps/plugins/mosaique.c @@ -50,6 +50,11 @@ #define MOSAIQUE_QUIT BUTTON_OFF #define MOSAIQUE_SPEED BUTTON_MODE #define MOSAIQUE_RESTART BUTTON_ON + +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define MOSAIQUE_QUIT BUTTON_MENU +#define MOSAIQUE_SPEED BUTTON_SELECT +#define MOSAIQUE_RESTART BUTTON_PLAY #endif enum plugin_status plugin_start(struct plugin_api* api, void* parameter) diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c index 21bf6064e6..68bc3968bf 100644 --- a/apps/plugins/pong.c +++ b/apps/plugins/pong.c @@ -56,6 +56,13 @@ #define PONG_RIGHT_UP BUTTON_ON #define PONG_RIGHT_DOWN BUTTON_MODE +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define PONG_QUIT BUTTON_SELECT +#define PONG_LEFT_UP BUTTON_MENU +#define PONG_LEFT_DOWN BUTTON_LEFT +#define PONG_RIGHT_UP BUTTON_RIGHT +#define PONG_RIGHT_DOWN BUTTON_PLAY + #endif static struct plugin_api* rb; diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index a0623da314..9fcc8cf563 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -22,6 +22,20 @@ #ifdef HAVE_LCD_BITMAP +#if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define ROCKBLOX_OFF BUTTON_MENU +#define ROCKBLOX_UP BUTTON_SCROLL_BACK +#define ROCKBLOX_DOWN BUTTON_SCROLL_FWD +#define ROCKBLOX_LEFT BUTTON_LEFT +#define ROCKBLOX_RIGHT BUTTON_RIGHT +#else +#define ROCKBLOX_OFF BUTTON_OFF +#define ROCKBLOX_UP BUTTON_UP +#define ROCKBLOX_DOWN BUTTON_DOWN +#define ROCKBLOX_LEFT BUTTON_LEFT +#define ROCKBLOX_RIGHT BUTTON_RIGHT +#endif + static const int start_x = 5; static const int start_y = 5; static const int max_x = 4 * 17; @@ -338,26 +352,26 @@ static int game_loop(void) button = rb->button_get_w_tmo(HZ/10); switch(button) { - case BUTTON_OFF: + case ROCKBLOX_OFF: return PLUGIN_OK; - case BUTTON_UP: - case BUTTON_UP | BUTTON_REPEAT: + case ROCKBLOX_UP: + case ROCKBLOX_UP | BUTTON_REPEAT: move_block(0,-3,0); break; - case BUTTON_DOWN: - case BUTTON_DOWN | BUTTON_REPEAT: + case ROCKBLOX_DOWN: + case ROCKBLOX_DOWN | BUTTON_REPEAT: move_block(0,3,0); break; - case BUTTON_RIGHT: - case BUTTON_RIGHT | BUTTON_REPEAT: + case ROCKBLOX_RIGHT: + case ROCKBLOX_RIGHT | BUTTON_REPEAT: move_block(0,0,1); break; - case BUTTON_LEFT: - case BUTTON_LEFT | BUTTON_REPEAT: + case ROCKBLOX_LEFT: + case ROCKBLOX_LEFT | BUTTON_REPEAT: move_down(); break; diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c index 846fd39bdd..d85d011e13 100644 --- a/apps/plugins/sliding_puzzle.c +++ b/apps/plugins/sliding_puzzle.c @@ -22,11 +22,15 @@ /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD #define PUZZLE_QUIT BUTTON_OFF +#define PUZZLE_UP BUTTON_UP +#define PUZZLE_DOWN BUTTON_DOWN #define PUZZLE_SHUFFLE BUTTON_F1 #define PUZZLE_PICTURE BUTTON_F2 #elif CONFIG_KEYPAD == ONDIO_PAD #define PUZZLE_QUIT BUTTON_OFF +#define PUZZLE_UP BUTTON_UP +#define PUZZLE_DOWN BUTTON_DOWN #define PUZZLE_SHUFFLE_PICTURE_PRE BUTTON_MENU #define PUZZLE_SHUFFLE (BUTTON_MENU | BUTTON_REPEAT) #define PUZZLE_PICTURE (BUTTON_MENU | BUTTON_REL) @@ -34,8 +38,18 @@ #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) #define PUZZLE_QUIT BUTTON_OFF +#define PUZZLE_UP BUTTON_UP +#define PUZZLE_DOWN BUTTON_DOWN #define PUZZLE_SHUFFLE BUTTON_SELECT #define PUZZLE_PICTURE BUTTON_ON + +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define PUZZLE_QUIT BUTTON_MENU +#define PUZZLE_UP BUTTON_SCROLL_BACK +#define PUZZLE_DOWN BUTTON_SCROLL_FWD +#define PUZZLE_SHUFFLE BUTTON_SELECT +#define PUZZLE_PICTURE BUTTON_PLAY + #endif static struct plugin_api* rb; @@ -295,12 +309,12 @@ static int puzzle_loop(void) move_spot(1, 0); break; - case BUTTON_UP: + case PUZZLE_UP: if ((hole/5)<3 && !puzzle_finished()) move_spot(0, -1); break; - case BUTTON_DOWN: + case PUZZLE_DOWN: if ((hole/5)>0 && !puzzle_finished()) move_spot(0, 1); break; diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index 693aabb44d..01716b2d0b 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c @@ -36,17 +36,30 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left; /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD #define SNAKE_QUIT BUTTON_OFF +#define SNAKE_UP BUTTON_UP +#define SNAKE_DOWN BUTTON_DOWN #define SNAKE_PLAYPAUSE BUTTON_PLAY #elif CONFIG_KEYPAD == ONDIO_PAD #define SNAKE_QUIT BUTTON_OFF +#define SNAKE_UP BUTTON_UP +#define SNAKE_DOWN BUTTON_DOWN #define SNAKE_PLAYPAUSE BUTTON_MENU #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) #define SNAKE_QUIT BUTTON_OFF +#define SNAKE_UP BUTTON_UP +#define SNAKE_DOWN BUTTON_DOWN #define SNAKE_PLAYPAUSE BUTTON_ON +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) + +#define SNAKE_QUIT (BUTTON_SELECT|BUTTON_MENU) +#define SNAKE_UP BUTTON_MENU +#define SNAKE_DOWN BUTTON_PLAY +#define SNAKE_PLAYPAUSE BUTTON_SELECT + #else #error "lacks keymapping" #endif @@ -236,13 +249,13 @@ void game (void) { button=rb->button_get(false); switch (button) { - case BUTTON_UP: + case SNAKE_UP: if (dir!=2) dir=0; break; case BUTTON_RIGHT: if (dir!=3) dir=1; break; - case BUTTON_DOWN: + case SNAKE_DOWN: if (dir!=0) dir=2; break; case BUTTON_LEFT: @@ -300,12 +313,12 @@ void game_init(void) { button=rb->button_get(true); switch (button) { case BUTTON_RIGHT: - case BUTTON_UP: + case SNAKE_UP: if (level<9) level++; break; case BUTTON_LEFT: - case BUTTON_DOWN: + case SNAKE_DOWN: if (level>1) level--; break; diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c index a726d42418..f5ee34b2cb 100644 --- a/apps/plugins/snake2.c +++ b/apps/plugins/snake2.c @@ -57,6 +57,8 @@ Head and Tail are stored /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD +#define SNAKE2_UP BUTTON_UP +#define SNAKE2_DOWN BUTTON_DOWN #define SNAKE2_QUIT BUTTON_OFF #define SNAKE2_LEVEL_UP BUTTON_UP #define SNAKE2_LEVEL_UP2 BUTTON_RIGHT @@ -67,6 +69,8 @@ Head and Tail are stored #define SNAKE2_PLAYPAUSE BUTTON_PLAY #elif CONFIG_KEYPAD == ONDIO_PAD +#define SNAKE2_UP BUTTON_UP +#define SNAKE2_DOWN BUTTON_DOWN #define SNAKE2_QUIT BUTTON_OFF #define SNAKE2_LEVEL_UP BUTTON_UP #define SNAKE2_LEVEL_DOWN BUTTON_DOWN @@ -76,6 +80,8 @@ Head and Tail are stored #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) +#define SNAKE2_UP BUTTON_UP +#define SNAKE2_DOWN BUTTON_DOWN #define SNAKE2_QUIT BUTTON_OFF #define SNAKE2_LEVEL_UP BUTTON_UP #define SNAKE2_LEVEL_UP2 BUTTON_RIGHT @@ -84,6 +90,18 @@ Head and Tail are stored #define SNAKE2_SELECT_MAZE BUTTON_REC #define SNAKE2_SELECT_TYPE BUTTON_MODE #define SNAKE2_PLAYPAUSE BUTTON_ON + +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) + +#define SNAKE2_UP BUTTON_MENU +#define SNAKE2_DOWN BUTTON_PLAY +#define SNAKE2_QUIT (BUTTON_SELECT | BUTTON_MENU) +#define SNAKE2_LEVEL_UP BUTTON_SCROLL_FWD +#define SNAKE2_LEVEL_DOWN BUTTON_SCROLL_BACK +#define SNAKE2_SELECT_MAZE BUTTON_LEFT +#define SNAKE2_SELECT_TYPE BUTTON_RIGHT +#define SNAKE2_PLAYPAUSE BUTTON_SELECT + #else #error "lacks keymapping" #endif @@ -1247,8 +1265,8 @@ void game (void) button = rb->button_get(false); switch (button) { - case BUTTON_UP: - case BUTTON_UP | BUTTON_REPEAT: + case SNAKE2_UP: + case SNAKE2_UP | BUTTON_REPEAT: if (dir != SOUTH) set_direction(NORTH); break; @@ -1257,8 +1275,8 @@ void game (void) if (dir != WEST) set_direction(EAST); break; - case BUTTON_DOWN: - case BUTTON_DOWN | BUTTON_REPEAT: + case SNAKE2_DOWN: + case SNAKE2_DOWN | BUTTON_REPEAT: if (dir != NORTH) set_direction(SOUTH); break; diff --git a/apps/plugins/snow.c b/apps/plugins/snow.c index 73ce386de9..06ec4ac5f6 100644 --- a/apps/plugins/snow.c +++ b/apps/plugins/snow.c @@ -34,6 +34,8 @@ /* variable button definitions */ #if CONFIG_KEYPAD == PLAYER_PAD #define SNOW_QUIT BUTTON_STOP +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define SNOW_QUIT BUTTON_MENU #else #define SNOW_QUIT BUTTON_OFF #endif diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index a341cf5416..545ea771ef 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -35,6 +35,8 @@ /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD +#define SOKOBAN_UP BUTTON_UP +#define SOKOBAN_DOWN BUTTON_DOWN #define SOKOBAN_QUIT BUTTON_OFF #define SOKOBAN_UNDO BUTTON_ON #define SOKOBAN_LEVEL_UP BUTTON_F3 @@ -42,6 +44,8 @@ #define SOKOBAN_LEVEL_REPEAT BUTTON_F2 #elif CONFIG_KEYPAD == ONDIO_PAD +#define SOKOBAN_UP BUTTON_UP +#define SOKOBAN_DOWN BUTTON_DOWN #define SOKOBAN_QUIT BUTTON_OFF #define SOKOBAN_UNDO_PRE BUTTON_MENU #define SOKOBAN_UNDO (BUTTON_MENU | BUTTON_REL) @@ -51,11 +55,24 @@ #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) +#define SOKOBAN_UP BUTTON_UP +#define SOKOBAN_DOWN BUTTON_DOWN #define SOKOBAN_QUIT BUTTON_OFF #define SOKOBAN_UNDO BUTTON_ON #define SOKOBAN_LEVEL_UP BUTTON_MODE #define SOKOBAN_LEVEL_DOWN BUTTON_REC #define SOKOBAN_LEVEL_REPEAT BUTTON_SELECT + +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define SOKOBAN_UP BUTTON_MENU +#define SOKOBAN_DOWN BUTTON_PLAY +#define SOKOBAN_QUIT (BUTTON_SELECT | BUTTON_MENU) +#define SOKOBAN_UNDO_PRE BUTTON_SELECT +#define SOKOBAN_UNDO (BUTTON_SELECT | BUTTON_REL) +#define SOKOBAN_LEVEL_UP (BUTTON_SELECT | BUTTON_RIGHT) +#define SOKOBAN_LEVEL_DOWN (BUTTON_SELECT | BUTTON_LEFT) +#define SOKOBAN_LEVEL_REPEAT (BUTTON_SELECT | BUTTON_PLAY) + #endif #if LCD_DEPTH > 1 @@ -180,7 +197,7 @@ static void add_undo(int button) bool storable; if ((button != BUTTON_LEFT) && (button != BUTTON_RIGHT) && - (button != BUTTON_UP) && (button != BUTTON_DOWN)) + (button != SOKOBAN_UP) && (button != SOKOBAN_DOWN)) return; if (undo_info.count != 0) { @@ -223,13 +240,13 @@ static void add_undo(int button) storable = false; break; - case BUTTON_UP: + case SOKOBAN_UP: row--; if (row < 0) storable = false; break; - case BUTTON_DOWN: + case SOKOBAN_DOWN: row++; if (row >= ROWS) storable = false; @@ -514,7 +531,7 @@ static bool sokoban_loop(void) switch(button) { - case BUTTON_OFF: + case SOKOBAN_QUIT: /* get out of here */ return PLUGIN_OK; @@ -691,7 +708,7 @@ static bool sokoban_loop(void) current_info.player.col++; break; - case BUTTON_UP: + case SOKOBAN_UP: switch(current_info.board[r-1][c]) { case ' ': /* if it is a blank spot */ case '.': /* if it is a home spot */ @@ -756,7 +773,7 @@ static bool sokoban_loop(void) current_info.player.row--; break; - case BUTTON_DOWN: + case SOKOBAN_DOWN: switch(current_info.board[r+1][c]) { case ' ': /* if it is a blank spot */ case '.': /* if it is a home spot */ diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index 30405a582f..efecaa854b 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c @@ -101,6 +101,22 @@ static struct plugin_api* rb; #define SOL_MENU_RUN2 BUTTON_RIGHT #define SOL_MENU_INFO BUTTON_MODE #define SOL_MENU_INFO2 BUTTON_REC + +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) + +#define SOL_QUIT (BUTTON_SELECT | BUTTON_MENU) +#define SOL_UP BUTTON_MENU +#define SOL_DOWN BUTTON_PLAY +#define SOL_LEFT BUTTON_LEFT +#define SOL_RIGHT BUTTON_RIGHT +#define SOL_MOVE BUTTON_SELECT +#define SOL_DRAW (BUTTON_SELECT | BUTTON_PLAY) +#define SOL_REM2CUR (BUTTON_SELECT | BUTTON_LEFT) +#define SOL_CUR2STACK (BUTTON_SELECT | BUTTON_RIGHT) +#define SOL_REM2STACK (BUTTON_LEFT | BUTTON_RIGHT) +#define SOL_MENU_RUN BUTTON_SELECT +#define SOL_MENU_INFO (BUTTON_PLAY | BUTTON_MENU) + #endif /* common help definitions */ @@ -132,6 +148,13 @@ static struct plugin_api* rb; #define HELP_SOL_CUR2STACK "SELECT..: Put the card under the cursor on one of the 4 final stacks." #define HELP_SOL_REM2STACK "PLAY+RIGHT: Put the card on top of the remains' stack on one of the 4 final stacks." +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define HELP_SOL_MOVE "SELECT: Select cards, Move cards, reveal hidden cards ..." +#define HELP_SOL_DRAW "SELECT+PLAY: Un-select a card if it was selected. Else, draw 3 new cards out of the remains' stack." +#define HELP_SOL_REM2CUR "SELECT+LEFT: Put the card on top of the remains' stack on top of the cursor." +#define HELP_SOL_CUR2STACK "SELECT+RIGHT..: Put the card under the cursor on one of the 4 final stacks." +#define HELP_SOL_REM2STACK "LEFT+RIGHT: Put the card on top of the remains' stack on one of the 4 final stacks." + #endif #if LCD_DEPTH>1 @@ -540,11 +563,11 @@ int solitaire_menu(unsigned char when) button = rb->button_get(true); switch(button){ - case BUTTON_UP: + case SOL_UP: cursor = (cursor + MENU_LENGTH - 1)%MENU_LENGTH; break; - case BUTTON_DOWN: + case SOL_DOWN: cursor = (cursor + 1)%MENU_LENGTH; break; @@ -576,7 +599,7 @@ int solitaire_menu(unsigned char when) rb->splash(HZ, true, "Solitaire for Rockbox by dionoea"); break; - case BUTTON_OFF: + case SOL_QUIT: return MENU_QUIT; default: diff --git a/apps/plugins/star.c b/apps/plugins/star.c index 9dd3659f52..ac85738577 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c @@ -62,6 +62,8 @@ /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD #define STAR_QUIT BUTTON_OFF +#define STAR_UP BUTTON_UP +#define STAR_DOWN BUTTON_DOWN #define STAR_TOGGLE_CONTROL BUTTON_ON #define STAR_TOGGLE_CONTROL2 BUTTON_PLAY #define STAR_LEVEL_UP BUTTON_F3 @@ -73,6 +75,8 @@ #elif CONFIG_KEYPAD == ONDIO_PAD #define STAR_QUIT BUTTON_OFF +#define STAR_UP BUTTON_UP +#define STAR_DOWN BUTTON_DOWN #define STAR_TOGGLE_CONTROL_PRE BUTTON_MENU #define STAR_TOGGLE_CONTROL (BUTTON_MENU | BUTTON_REL) #define STAR_LEVEL_UP (BUTTON_MENU | BUTTON_RIGHT) @@ -83,12 +87,27 @@ #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) #define STAR_QUIT BUTTON_OFF +#define STAR_UP BUTTON_UP +#define STAR_DOWN BUTTON_DOWN #define STAR_TOGGLE_CONTROL_PRE BUTTON_MODE #define STAR_TOGGLE_CONTROL (BUTTON_MODE | BUTTON_REL) #define STAR_LEVEL_UP (BUTTON_MODE | BUTTON_RIGHT) #define STAR_LEVEL_DOWN (BUTTON_MODE | BUTTON_LEFT) #define STAR_LEVEL_REPEAT (BUTTON_MODE | BUTTON_UP) #define STAR_MENU_RUN BUTTON_RIGHT + +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) + +#define STAR_QUIT (BUTTON_SELECT | BUTTON_MENU) +#define STAR_UP BUTTON_SCROLL_BACK +#define STAR_DOWN BUTTON_SCROLL_FWD +#define STAR_TOGGLE_CONTROL_PRE BUTTON_MENU +#define STAR_TOGGLE_CONTROL (BUTTON_MENU | BUTTON_REL) +#define STAR_LEVEL_UP (BUTTON_SELECT | BUTTON_RIGHT) +#define STAR_LEVEL_DOWN (BUTTON_SELECT | BUTTON_LEFT) +#define STAR_LEVEL_REPEAT (BUTTON_SELECT | BUTTON_PLAY) +#define STAR_MENU_RUN BUTTON_RIGHT + #endif /* function returns because of USB? */ @@ -427,7 +446,7 @@ static void star_display_text(char *str, bool waitkey) switch (key) { case STAR_MENU_RUN: - case BUTTON_DOWN: + case STAR_DOWN: go_on = true; break; @@ -601,11 +620,11 @@ static int star_run_game(void) move_x = 1; break; - case BUTTON_UP: + case STAR_UP: move_y = -1; break; - case BUTTON_DOWN: + case STAR_DOWN: move_y = 1; break; @@ -777,11 +796,11 @@ static int star_menu(void) { case STAR_QUIT: return PLUGIN_OK; - case BUTTON_UP: + case STAR_UP: if (menu_y > 0) move_y = -1; break; - case BUTTON_DOWN: + case STAR_DOWN: if (menu_y < 3) move_y = 1; break; diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c index c697bae624..c0adfc5ca0 100644 --- a/apps/plugins/starfield.c +++ b/apps/plugins/starfield.c @@ -24,11 +24,19 @@ static struct plugin_api* rb; /* global api struct pointer */ /* Key assignement */ +#if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define STARFIELD_QUIT BUTTON_MENU +#define STARFIELD_INCREASE_ZMOVE BUTTON_SCROLL_FWD +#define STARFIELD_DECREASE_ZMOVE BUTTON_SCROLL_BACK +#define STARFIELD_INCREASE_NB_STARS BUTTON_RIGHT +#define STARFIELD_DECREASE_NB_STARS BUTTON_LEFT +#else #define STARFIELD_QUIT BUTTON_OFF #define STARFIELD_INCREASE_ZMOVE BUTTON_UP #define STARFIELD_DECREASE_ZMOVE BUTTON_DOWN #define STARFIELD_INCREASE_NB_STARS BUTTON_RIGHT #define STARFIELD_DECREASE_NB_STARS BUTTON_LEFT +#endif #define LCD_CENTER_X (LCD_WIDTH/2) #define LCD_CENTER_Y (LCD_HEIGHT/2) diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c index 3a8eb74c2e..8023341350 100644 --- a/apps/plugins/stats.c +++ b/apps/plugins/stats.c @@ -28,6 +28,8 @@ static int fontwidth, fontheight; #if CONFIG_KEYPAD == PLAYER_PAD #define STATS_STOP BUTTON_STOP +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define STATS_STOP BUTTON_MENU #else #define STATS_STOP BUTTON_OFF #endif diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c index 05e57905ac..c4aeaf2711 100644 --- a/apps/plugins/stopwatch.c +++ b/apps/plugins/stopwatch.c @@ -61,6 +61,13 @@ #define STOPWATCH_LAP_TIMER BUTTON_ON #define STOPWATCH_SCROLL_UP BUTTON_RIGHT #define STOPWATCH_SCROLL_DOWN BUTTON_LEFT +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define STOPWATCH_QUIT BUTTON_MENU +#define STOPWATCH_START_STOP BUTTON_SELECT +#define STOPWATCH_RESET_TIMER BUTTON_LEFT +#define STOPWATCH_LAP_TIMER BUTTON_RIGHT +#define STOPWATCH_SCROLL_UP BUTTON_SCROLL_FWD +#define STOPWATCH_SCROLL_DOWN BUTTON_SCROLL_BACK #endif static struct plugin_api* rb; diff --git a/apps/plugins/sudoku.c b/apps/plugins/sudoku.c index 3c6d9538ca..a161b08466 100644 --- a/apps/plugins/sudoku.c +++ b/apps/plugins/sudoku.c @@ -68,12 +68,16 @@ Example ".ss" file, and one with a saved state: /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD #define SUDOKU_BUTTON_QUIT BUTTON_OFF +#define SUDOKU_BUTTON_UP BUTTON_UP +#define SUDOKU_BUTTON_DOWN BUTTON_DOWN #define SUDOKU_BUTTON_TOGGLE BUTTON_PLAY #define SUDOKU_BUTTON_MENU BUTTON_F1 #define SUDOKU_BUTTON_POSSIBLE BUTTON_F2 #elif CONFIG_KEYPAD == ONDIO_PAD #define SUDOKU_BUTTON_QUIT BUTTON_OFF +#define SUDOKU_BUTTON_UP BUTTON_UP +#define SUDOKU_BUTTON_DOWN BUTTON_DOWN #define SUDOKU_BUTTON_ALTTOGGLE (BUTTON_MENU | BUTTON_DOWN) #define SUDOKU_BUTTON_TOGGLE_PRE BUTTON_MENU #define SUDOKU_BUTTON_TOGGLE (BUTTON_MENU | BUTTON_REL) @@ -84,11 +88,23 @@ Example ".ss" file, and one with a saved state: #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ (CONFIG_KEYPAD == IRIVER_H300_PAD) #define SUDOKU_BUTTON_QUIT BUTTON_OFF +#define SUDOKU_BUTTON_UP BUTTON_UP +#define SUDOKU_BUTTON_DOWN BUTTON_DOWN #define SUDOKU_BUTTON_ALTTOGGLE BUTTON_ON #define SUDOKU_BUTTON_TOGGLE BUTTON_SELECT #define SUDOKU_BUTTON_MENU BUTTON_MODE #define SUDOKU_BUTTON_POSSIBLE BUTTON_REC +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) + +#define SUDOKU_BUTTON_QUIT (BUTTON_SELECT | BUTTON_MENU) +#define SUDOKU_BUTTON_UP BUTTON_SCROLL_BACK +#define SUDOKU_BUTTON_DOWN BUTTON_SCROLL_FWD +#define SUDOKU_BUTTON_TOGGLE BUTTON_SELECT +#define SUDOKU_BUTTON_MENU BUTTON_MENU +#define SUDOKU_BUTTON_POSSIBLE (BUTTON_SELECT | BUTTON_LEFT) + + #elif #error SUDOKU: Unsupported keypad #endif @@ -2195,8 +2211,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) break; /* move cursor up */ - case BUTTON_UP: - case (BUTTON_UP | BUTTON_REPEAT): + case SUDOKU_BUTTON_UP: + case (SUDOKU_BUTTON_UP | BUTTON_REPEAT): if (state.y==0) { move_cursor(&state,state.x,8); } else { @@ -2205,8 +2221,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) break; /* move cursor down */ - case BUTTON_DOWN: - case (BUTTON_DOWN | BUTTON_REPEAT): + case SUDOKU_BUTTON_DOWN: + case (SUDOKU_BUTTON_DOWN | BUTTON_REPEAT): if (state.y==8) { move_cursor(&state,state.x,0); } else { diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index c695f2f7f0..2db3c6ec9e 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c @@ -119,6 +119,16 @@ #define VIEWER_COLUMN_LEFT (BUTTON_ON | BUTTON_LEFT) #define VIEWER_COLUMN_RIGHT (BUTTON_ON | BUTTON_RIGHT) +#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) +#define VIEWER_QUIT BUTTON_MENU +#define VIEWER_PAGE_UP BUTTON_SCROLL_FWD +#define VIEWER_PAGE_DOWN BUTTON_SCROLL_BACK +#define VIEWER_SCREEN_LEFT BUTTON_LEFT +#define VIEWER_SCREEN_RIGHT BUTTON_RIGHT +#define VIEWER_MODE_WRAP (BUTTON_SELECT | BUTTON_LEFT) +#define VIEWER_MODE_LINE (BUTTON_SELECT | BUTTON_PLAY) +#define VIEWER_MODE_WIDTH (BUTTON_SELECT | BUTTON_RIGHT) + #endif enum {