mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-25 22:07:34 +00:00
GP2XWIZ: Clean up input code.
* Clean up the if/switch mess. * Also add missing Caanoo icon. svn-id: r52629
This commit is contained in:
parent
87a6b631bf
commit
56b09b605d
@ -2,3 +2,4 @@
|
|||||||
name="ScummVM"
|
name="ScummVM"
|
||||||
path="/scummvm/scummvm.gpe"
|
path="/scummvm/scummvm.gpe"
|
||||||
icon="/scummvm/scummvm.png"
|
icon="/scummvm/scummvm.png"
|
||||||
|
title="/scummvm/scummvmb.png"
|
||||||
|
BIN
backends/platform/gp2xwiz/build/scummvmb.png
Normal file
BIN
backends/platform/gp2xwiz/build/scummvmb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
@ -16,6 +16,7 @@ caanoo-bundle: $(EXECUTABLE)
|
|||||||
|
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/caanoo/scummvm.gpe $(bundle_name)/scummvm/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/caanoo/scummvm.gpe $(bundle_name)/scummvm/
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.png $(bundle_name)/scummvm/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.png $(bundle_name)/scummvm/
|
||||||
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvmb.png $(bundle_name)/scummvm/
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/README-GP2XWIZ $(bundle_name)/scummvm/README-CAANOO
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/README-GP2XWIZ $(bundle_name)/scummvm/README-CAANOO
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.ini $(bundle_name)/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.ini $(bundle_name)/
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ caanoo-bundle-debug: $(EXECUTABLE)
|
|||||||
|
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/caanoo/scummvm-gdb.gpe $(bundle_name)/scummvm/scummvm.gpe
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/caanoo/scummvm-gdb.gpe $(bundle_name)/scummvm/scummvm.gpe
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.png $(bundle_name)/scummvm/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.png $(bundle_name)/scummvm/
|
||||||
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvmb.png $(bundle_name)/scummvm/
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/README-GP2XWIZ $(bundle_name)/scummvm/README-CAANOO
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/README-GP2XWIZ $(bundle_name)/scummvm/README-CAANOO
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.ini $(bundle_name)/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.ini $(bundle_name)/
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ gp2xwiz-bundle: $(EXECUTABLE)
|
|||||||
|
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.gpe $(bundle_name)/scummvm/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.gpe $(bundle_name)/scummvm/
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.png $(bundle_name)/scummvm/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.png $(bundle_name)/scummvm/
|
||||||
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvmb.png $(bundle_name)/scummvm/
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/README-GP2XWIZ $(bundle_name)/scummvm/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/README-GP2XWIZ $(bundle_name)/scummvm/
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.ini $(bundle_name)/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.ini $(bundle_name)/
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ gp2xwiz-bundle-debug: $(EXECUTABLE)
|
|||||||
|
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm-gdb.gpe $(bundle_name)/scummvm/scummvm.gpe
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm-gdb.gpe $(bundle_name)/scummvm/scummvm.gpe
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.png $(bundle_name)/scummvm/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.png $(bundle_name)/scummvm/
|
||||||
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvmb.png $(bundle_name)/scummvm/
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/README-GP2XWIZ $(bundle_name)/scummvm/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/README-GP2XWIZ $(bundle_name)/scummvm/
|
||||||
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.ini $(bundle_name)/
|
$(CP) $(srcdir)/backends/platform/gp2xwiz/build/scummvm.ini $(bundle_name)/
|
||||||
|
|
||||||
|
@ -272,32 +272,33 @@ bool OSystem_GPH::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
|
|||||||
/* Custom handleJoyButtonDown/handleJoyButtonUp to deal with the joystick buttons on GPH devices */
|
/* Custom handleJoyButtonDown/handleJoyButtonUp to deal with the joystick buttons on GPH devices */
|
||||||
|
|
||||||
bool OSystem_GPH::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
bool OSystem_GPH::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
||||||
_stickBtn[ev.jbutton.button] = 1;
|
switch (ev.jbutton.button) {
|
||||||
if (ev.jbutton.button == BUTTON_B) {
|
case BUTTON_UP:
|
||||||
event.type = Common::EVENT_LBUTTONDOWN;
|
case BUTTON_UPLEFT:
|
||||||
fillMouseEvent(event, _km.x, _km.y);
|
case BUTTON_LEFT:
|
||||||
} else if (ev.jbutton.button == BUTTON_CLICK) {
|
case BUTTON_DOWNLEFT:
|
||||||
event.type = Common::EVENT_LBUTTONDOWN;
|
case BUTTON_DOWN:
|
||||||
fillMouseEvent(event, _km.x, _km.y);
|
case BUTTON_DOWNRIGHT:
|
||||||
} else if (ev.jbutton.button == BUTTON_X) {
|
case BUTTON_RIGHT:
|
||||||
event.type = Common::EVENT_RBUTTONDOWN;
|
case BUTTON_UPRIGHT:
|
||||||
fillMouseEvent(event, _km.x, _km.y);
|
|
||||||
} else if (_stickBtn[BUTTON_L] && (ev.jbutton.button == BUTTON_SELECT)) {
|
|
||||||
event.type = Common::EVENT_QUIT;
|
|
||||||
#if !defined (CAANOO)
|
|
||||||
} else if (ev.jbutton.button < 8) {
|
|
||||||
moveStick();
|
moveStick();
|
||||||
event.type = Common::EVENT_MOUSEMOVE;
|
event.type = Common::EVENT_MOUSEMOVE;
|
||||||
fillMouseEvent(event, _km.x, _km.y);
|
fillMouseEvent(event, _km.x, _km.y);
|
||||||
#endif
|
break;
|
||||||
} else {
|
case BUTTON_B:
|
||||||
event.type = Common::EVENT_KEYDOWN;
|
case BUTTON_CLICK:
|
||||||
event.kbd.flags = 0;
|
event.type = Common::EVENT_LBUTTONDOWN;
|
||||||
switch (ev.jbutton.button) {
|
fillMouseEvent(event, _km.x, _km.y);
|
||||||
|
break;
|
||||||
|
case BUTTON_X:
|
||||||
|
event.type = Common::EVENT_RBUTTONDOWN;
|
||||||
|
fillMouseEvent(event, _km.x, _km.y);
|
||||||
|
break;
|
||||||
case BUTTON_L:
|
case BUTTON_L:
|
||||||
BUTTON_STATE_L = true;
|
BUTTON_STATE_L = true;
|
||||||
break;
|
break;
|
||||||
case BUTTON_R:
|
case BUTTON_R:
|
||||||
|
event.type = Common::EVENT_KEYDOWN;
|
||||||
if (BUTTON_STATE_L == true) {
|
if (BUTTON_STATE_L == true) {
|
||||||
#ifdef ENABLE_VKEYBD
|
#ifdef ENABLE_VKEYBD
|
||||||
event.kbd.keycode = Common::KEYCODE_F7;
|
event.kbd.keycode = Common::KEYCODE_F7;
|
||||||
@ -312,7 +313,8 @@ bool OSystem_GPH::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BUTTON_SELECT:
|
case BUTTON_SELECT:
|
||||||
case BUTTON_HELP2:
|
case BUTTON_HOME:
|
||||||
|
event.type = Common::EVENT_KEYDOWN;
|
||||||
if (BUTTON_STATE_L == true) {
|
if (BUTTON_STATE_L == true) {
|
||||||
event.type = Common::EVENT_QUIT;
|
event.type = Common::EVENT_QUIT;
|
||||||
} else {
|
} else {
|
||||||
@ -321,6 +323,7 @@ bool OSystem_GPH::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BUTTON_A:
|
case BUTTON_A:
|
||||||
|
event.type = Common::EVENT_KEYDOWN;
|
||||||
if (BUTTON_STATE_L == true) {
|
if (BUTTON_STATE_L == true) {
|
||||||
event.type = Common::EVENT_PREDICTIVE_DIALOG;
|
event.type = Common::EVENT_PREDICTIVE_DIALOG;
|
||||||
} else {
|
} else {
|
||||||
@ -329,14 +332,15 @@ bool OSystem_GPH::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BUTTON_Y:
|
case BUTTON_Y:
|
||||||
|
event.type = Common::EVENT_KEYDOWN;
|
||||||
if (BUTTON_STATE_L == true) {
|
if (BUTTON_STATE_L == true) {
|
||||||
GPH::ToggleTapMode();
|
GPH::ToggleTapMode();
|
||||||
if (GPH::tapmodeLevel == TAPMODE_LEFT) {
|
if (GPH::tapmodeLevel == TAPMODE_LEFT) {
|
||||||
displayMessageOnOSD("Touchscreen 'Tap Mode': Left Click");
|
displayMessageOnOSD("Touchscreen 'Tap Mode' - Left Click");
|
||||||
} else if (GPH::tapmodeLevel == TAPMODE_RIGHT) {
|
} else if (GPH::tapmodeLevel == TAPMODE_RIGHT) {
|
||||||
displayMessageOnOSD("Touchscreen 'Tap Mode': Right Click");
|
displayMessageOnOSD("Touchscreen 'Tap Mode' - Right Click");
|
||||||
} else if (GPH::tapmodeLevel == TAPMODE_HOVER) {
|
} else if (GPH::tapmodeLevel == TAPMODE_HOVER) {
|
||||||
displayMessageOnOSD("Touchscreen 'Tap Mode': Hover (No Click)");
|
displayMessageOnOSD("Touchscreen 'Tap Mode' - Hover (No Click)");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
event.kbd.keycode = Common::KEYCODE_SPACE;
|
event.kbd.keycode = Common::KEYCODE_SPACE;
|
||||||
@ -345,6 +349,7 @@ bool OSystem_GPH::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
|||||||
break;
|
break;
|
||||||
case BUTTON_MENU:
|
case BUTTON_MENU:
|
||||||
case BUTTON_HELP:
|
case BUTTON_HELP:
|
||||||
|
event.type = Common::EVENT_KEYDOWN;
|
||||||
if (BUTTON_STATE_L == true) {
|
if (BUTTON_STATE_L == true) {
|
||||||
event.type = Common::EVENT_MAINMENU;
|
event.type = Common::EVENT_MAINMENU;
|
||||||
} else {
|
} else {
|
||||||
@ -371,7 +376,7 @@ bool OSystem_GPH::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
|||||||
case BUTTON_HOLD:
|
case BUTTON_HOLD:
|
||||||
event.type = Common::EVENT_QUIT;
|
event.type = Common::EVENT_QUIT;
|
||||||
break;
|
break;
|
||||||
case BUTTON_HOME:
|
case BUTTON_HELP2:
|
||||||
GPH::ToggleTapMode();
|
GPH::ToggleTapMode();
|
||||||
if (GPH::tapmodeLevel == TAPMODE_LEFT) {
|
if (GPH::tapmodeLevel == TAPMODE_LEFT) {
|
||||||
displayMessageOnOSD("Touchscreen 'Tap Mode': Left Click");
|
displayMessageOnOSD("Touchscreen 'Tap Mode': Left Click");
|
||||||
@ -382,46 +387,54 @@ bool OSystem_GPH::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OSystem_GPH::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
|
bool OSystem_GPH::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
|
||||||
_stickBtn[ev.jbutton.button] = 0;
|
switch (ev.jbutton.button) {
|
||||||
if (ev.jbutton.button == BUTTON_B) {
|
case BUTTON_UP:
|
||||||
event.type = Common::EVENT_LBUTTONUP;
|
case BUTTON_UPLEFT:
|
||||||
fillMouseEvent(event, _km.x, _km.y);
|
case BUTTON_LEFT:
|
||||||
} else if (ev.jbutton.button == BUTTON_CLICK) {
|
case BUTTON_DOWNLEFT:
|
||||||
event.type = Common::EVENT_LBUTTONUP;
|
case BUTTON_DOWN:
|
||||||
fillMouseEvent(event, _km.x, _km.y);
|
case BUTTON_DOWNRIGHT:
|
||||||
} else if (ev.jbutton.button == BUTTON_X) {
|
case BUTTON_RIGHT:
|
||||||
event.type = Common::EVENT_RBUTTONUP;
|
case BUTTON_UPRIGHT:
|
||||||
fillMouseEvent(event, _km.x, _km.y);
|
|
||||||
#if !defined (CAANOO)
|
|
||||||
} else if (ev.jbutton.button < 8) {
|
|
||||||
moveStick();
|
moveStick();
|
||||||
event.type = Common::EVENT_MOUSEMOVE;
|
event.type = Common::EVENT_MOUSEMOVE;
|
||||||
fillMouseEvent(event, _km.x, _km.y);
|
fillMouseEvent(event, _km.x, _km.y);
|
||||||
#endif
|
break;
|
||||||
} else {
|
case BUTTON_B:
|
||||||
event.type = Common::EVENT_KEYUP;
|
case BUTTON_CLICK:
|
||||||
event.kbd.flags = 0;
|
event.type = Common::EVENT_LBUTTONUP;
|
||||||
switch (ev.jbutton.button) {
|
fillMouseEvent(event, _km.x, _km.y);
|
||||||
|
break;
|
||||||
|
case BUTTON_X:
|
||||||
|
event.type = Common::EVENT_RBUTTONUP;
|
||||||
|
fillMouseEvent(event, _km.x, _km.y);
|
||||||
|
break;
|
||||||
|
case BUTTON_L:
|
||||||
|
BUTTON_STATE_L = true;
|
||||||
|
break;
|
||||||
case BUTTON_SELECT:
|
case BUTTON_SELECT:
|
||||||
case BUTTON_HELP2:
|
case BUTTON_HOME:
|
||||||
|
event.type = Common::EVENT_KEYUP;
|
||||||
event.kbd.keycode = Common::KEYCODE_ESCAPE;
|
event.kbd.keycode = Common::KEYCODE_ESCAPE;
|
||||||
event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
|
event.kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
|
||||||
break;
|
break;
|
||||||
case BUTTON_A:
|
case BUTTON_A:
|
||||||
|
event.type = Common::EVENT_KEYUP;
|
||||||
event.kbd.keycode = Common::KEYCODE_PERIOD;
|
event.kbd.keycode = Common::KEYCODE_PERIOD;
|
||||||
event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0);
|
event.kbd.ascii = mapKey(SDLK_PERIOD, ev.key.keysym.mod, 0);
|
||||||
break;
|
break;
|
||||||
case BUTTON_Y:
|
case BUTTON_Y:
|
||||||
|
event.type = Common::EVENT_KEYUP;
|
||||||
event.kbd.keycode = Common::KEYCODE_SPACE;
|
event.kbd.keycode = Common::KEYCODE_SPACE;
|
||||||
event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0);
|
event.kbd.ascii = mapKey(SDLK_SPACE, ev.key.keysym.mod, 0);
|
||||||
break;
|
break;
|
||||||
case BUTTON_MENU:
|
case BUTTON_MENU:
|
||||||
case BUTTON_HELP:
|
case BUTTON_HELP:
|
||||||
|
event.type = Common::EVENT_KEYUP;
|
||||||
if (BUTTON_STATE_L == true) {
|
if (BUTTON_STATE_L == true) {
|
||||||
event.type = Common::EVENT_MAINMENU;
|
event.type = Common::EVENT_MAINMENU;
|
||||||
} else {
|
} else {
|
||||||
@ -429,10 +442,8 @@ bool OSystem_GPH::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
|
|||||||
event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
|
event.kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BUTTON_L:
|
|
||||||
BUTTON_STATE_L = false;
|
|
||||||
break;
|
|
||||||
case BUTTON_R:
|
case BUTTON_R:
|
||||||
|
event.type = Common::EVENT_KEYUP;
|
||||||
if (BUTTON_STATE_L == true) {
|
if (BUTTON_STATE_L == true) {
|
||||||
#ifdef ENABLE_VKEYBD
|
#ifdef ENABLE_VKEYBD
|
||||||
event.kbd.keycode = Common::KEYCODE_F7;
|
event.kbd.keycode = Common::KEYCODE_F7;
|
||||||
@ -452,10 +463,9 @@ bool OSystem_GPH::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
|
|||||||
break;
|
break;
|
||||||
case BUTTON_HOLD:
|
case BUTTON_HOLD:
|
||||||
break;
|
break;
|
||||||
case BUTTON_HOME:
|
case BUTTON_HELP2:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user