all repos — mgba @ 346503cd41793fe6a7dfe7de6d018032d10cda97

mGBA Game Boy Advance Emulator

GUI: Fix non-touch support
Jeffrey Pfau jeffrey@endrift.com
Sat, 05 Sep 2015 00:50:51 -0700
commit

346503cd41793fe6a7dfe7de6d018032d10cda97

parent

db994ef8aba0ba122521a600eda9fdb62190cfae

4 files changed, 4 insertions(+), 4 deletions(-)

jump to
M src/platform/3ds/main.csrc/platform/3ds/main.c

@@ -238,7 +238,7 @@

static enum GUICursorState _pollCursor(int* x, int* y) { hidScanInput(); if (!(hidKeysHeld() & KEY_TOUCH)) { - return GUI_CURSOR_UP; + return GUI_CURSOR_NOT_PRESENT; } touchPosition pos; hidTouchRead(&pos);
M src/platform/psp2/main.csrc/platform/psp2/main.c

@@ -68,7 +68,7 @@ static enum GUICursorState _pollCursor(int* x, int* y) {

SceTouchData touch; sceTouchPeek(0, &touch, 1); if (touch.reportNum < 1) { - return GUI_CURSOR_UP; + return GUI_CURSOR_NOT_PRESENT; } *x = touch.report[0].x / 2; *y = touch.report[0].y / 2;
M src/util/gui.csrc/util/gui.c

@@ -43,7 +43,7 @@ if (dragX * dragX + dragY * dragY > 25) {

params->cursorState = GUI_CURSOR_DRAGGING; return GUI_CURSOR_DRAGGING; } - if (state == GUI_CURSOR_UP) { + if (state == GUI_CURSOR_UP || state == GUI_CURSOR_NOT_PRESENT) { params->cursorState = GUI_CURSOR_UP; return GUI_CURSOR_CLICKED; }
M src/util/gui/menu.csrc/util/gui/menu.c

@@ -80,7 +80,7 @@ } else {

return GUI_MENU_EXIT_ACCEPT; } } - if ((cursorOverItem == 1 && cursor == GUI_CURSOR_UP)) { + if (cursorOverItem == 1 && (cursor == GUI_CURSOR_UP || cursor == GUI_CURSOR_NOT_PRESENT)) { cursorOverItem = 2; } if (newInput & (1 << GUI_INPUT_BACK)) {