GUI: Fix non-touch support
Jeffrey Pfau jeffrey@endrift.com
Sat, 05 Sep 2015 00:50:51 -0700
4 files changed,
4 insertions(+),
4 deletions(-)
M
src/platform/3ds/main.c
→
src/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.c
→
src/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.c
→
src/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; }