Index: apps/plugins/sudoku/sudoku.h =================================================================== --- apps/plugins/sudoku/sudoku.h (revision 16019) +++ apps/plugins/sudoku/sudoku.h (working copy) @@ -76,7 +76,7 @@ #define SUDOKU_BUTTON_MENU BUTTON_MENU #define SUDOKU_BUTTON_LEFT BUTTON_SCROLL_BACK #define SUDOKU_BUTTON_RIGHT BUTTON_SCROLL_FWD -#define SUDOKU_BUTTON_ALTTOGGLE BUTTON_SELECT +#define SUDOKU_BUTTON_CHANGEDIR BUTTON_SELECT #define SUDOKU_BUTTON_TOGGLE BUTTON_RIGHT #define SUDOKU_BUTTON_TOGGLEBACK BUTTON_LEFT #define SUDOKU_BUTTON_POSSIBLE BUTTON_PLAY Index: apps/plugins/sudoku/sudoku.c =================================================================== --- apps/plugins/sudoku/sudoku.c (revision 16019) +++ apps/plugins/sudoku/sudoku.c (working copy) @@ -180,6 +180,12 @@ #endif /* Layout */ +#ifdef SUDOKU_BUTTON_CHANGEDIR +int invertdir=0; +#else +#define invertdir 0 +#endif + #define CFGFILE_VERSION 0 /* Current config file version */ #define CFGFILE_MINVERSION 0 /* Minimum config file version to accept */ @@ -1328,36 +1334,52 @@ /* move cursor left */ case SUDOKU_BUTTON_LEFT: case (SUDOKU_BUTTON_LEFT | BUTTON_REPEAT): - if (state.x==0) { + if ( (state.x==0&&invertdir==0) || (state.y==0&&invertdir==1) ) { #ifndef SUDOKU_BUTTON_UP - if (state.y==0) { + if ( (state.y==0&&invertdir==0) || (state.x==0&&invertdir==1)) { move_cursor(&state,8,8); - } else { - move_cursor(&state,8,state.y-1); + } else { + if (invertdir==0) { + move_cursor(&state,8,state.y-1); + } else { + move_cursor(&state,state.x-1,8); + } } #else move_cursor(&state,8,state.y); #endif - } else { - move_cursor(&state,state.x-1,state.y); + } else { + if (invertdir==0) { + move_cursor(&state,state.x-1,state.y); + } else { + move_cursor(&state,state.x,state.y-1); + } } break; /* move cursor right */ case SUDOKU_BUTTON_RIGHT: case (SUDOKU_BUTTON_RIGHT | BUTTON_REPEAT): - if (state.x==8) { + if ( (state.x==8&&invertdir==0) || (state.y==8&&invertdir==1) ) { #ifndef SUDOKU_BUTTON_DOWN - if (state.y==8) { + if ( (state.y==8&&invertdir==0) || (state.x==8&&invertdir==1) ) { move_cursor(&state,0,0); - } else { - move_cursor(&state,0,state.y+1); + } else { + if (invertdir==0) { + move_cursor(&state,0,state.y+1); + } else { + move_cursor(&state,state.x+1,0); + } } #else move_cursor(&state,0,state.y); #endif - } else { - move_cursor(&state,state.x+1,state.y); + } else { + if (invertdir==0) { + move_cursor(&state,state.x+1,state.y); + } else { + move_cursor(&state,state.x,state.y+1); + } } break; @@ -1421,6 +1443,13 @@ } break; #endif + +#ifdef SUDOKU_BUTTON_CHANGEDIR + case SUDOKU_BUTTON_CHANGEDIR: + /* Change scroll wheel direction */ + invertdir=!invertdir; + break; +#endif default: if (rb->default_event_handler(button) == SYS_USB_CONNECTED) { /* Quit if USB has been connected */