From 6fb50d562f9716a930ecb4fe3d20047d506e4ed5 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 10 Dec 2017 15:04:54 +0100 Subject: PS3: Remove gamepad button mapping SDL_PSL1GHT now supports the GameController API. ScummVM's default mapping is now used. --- backends/events/ps3sdl/ps3sdl-events.cpp | 90 -------------------------------- backends/events/ps3sdl/ps3sdl-events.h | 2 - 2 files changed, 92 deletions(-) (limited to 'backends/events/ps3sdl') diff --git a/backends/events/ps3sdl/ps3sdl-events.cpp b/backends/events/ps3sdl/ps3sdl-events.cpp index 01cdc2f0f6..50655597a5 100644 --- a/backends/events/ps3sdl/ps3sdl-events.cpp +++ b/backends/events/ps3sdl/ps3sdl-events.cpp @@ -31,96 +31,6 @@ #include "common/util.h" #include "common/events.h" -enum { - BTN_LEFT = 0, - BTN_DOWN = 1, - BTN_RIGHT = 2, - BTN_UP = 3, - - BTN_START = 4, - BTN_R3 = 5, - BTN_L3 = 6, - BTN_SELECT = 7, - - BTN_SQUARE = 8, - BTN_CROSS = 9, - BTN_CIRCLE = 10, - BTN_TRIANGLE = 11, - - BTN_R1 = 12, - BTN_L1 = 13, - BTN_R2 = 14, - BTN_L2 = 15 -}; - -bool PS3SdlEventSource::handleJoyButtonDown(SDL_Event &ev, Common::Event &event) { - - event.kbd.flags = 0; - - switch (ev.jbutton.button) { - case BTN_CROSS: // Left mouse button - event.type = Common::EVENT_LBUTTONDOWN; - processMouseEvent(event, _km.x / MULTIPLIER, _km.y / MULTIPLIER); - break; - case BTN_CIRCLE: // Right mouse button - event.type = Common::EVENT_RBUTTONDOWN; - processMouseEvent(event, _km.x / MULTIPLIER, _km.y / MULTIPLIER); - break; - case BTN_TRIANGLE: // Game menu - event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = Common::KEYCODE_F5; - event.kbd.ascii = mapKey(SDLK_F5, (SDLMod) ev.key.keysym.mod, 0); - break; - case BTN_SELECT: // Virtual keyboard -#ifdef ENABLE_VKEYBD - event.type = Common::EVENT_VIRTUAL_KEYBOARD; -#endif - break; - case BTN_SQUARE: // Escape - event.type = Common::EVENT_KEYDOWN; - event.kbd.keycode = Common::KEYCODE_ESCAPE; - event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod) ev.key.keysym.mod, 0); - break; - case BTN_L1: // Predictive input dialog - event.type = Common::EVENT_PREDICTIVE_DIALOG; - break; - case BTN_START: // ScummVM in game menu - event.type = Common::EVENT_MAINMENU; - break; - } - return true; -} - -bool PS3SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) { - - event.kbd.flags = 0; - - switch (ev.jbutton.button) { - case BTN_CROSS: // Left mouse button - event.type = Common::EVENT_LBUTTONUP; - processMouseEvent(event, _km.x / MULTIPLIER, _km.y / MULTIPLIER); - break; - case BTN_CIRCLE: // Right mouse button - event.type = Common::EVENT_RBUTTONUP; - processMouseEvent(event, _km.x / MULTIPLIER, _km.y / MULTIPLIER); - break; - case BTN_TRIANGLE: // Game menu - event.type = Common::EVENT_KEYUP; - event.kbd.keycode = Common::KEYCODE_F5; - event.kbd.ascii = mapKey(SDLK_F5, (SDLMod) ev.key.keysym.mod, 0); - break; - case BTN_SELECT: // Virtual keyboard - // Handled in key down - break; - case BTN_SQUARE: // Escape - event.type = Common::EVENT_KEYUP; - event.kbd.keycode = Common::KEYCODE_ESCAPE; - event.kbd.ascii = mapKey(SDLK_ESCAPE, (SDLMod) ev.key.keysym.mod, 0); - break; - } - return true; -} - /** * The XMB (PS3 in game menu) needs the screen buffers to be constantly flip while open. * This pauses execution and keeps redrawing the screen until the XMB is closed. diff --git a/backends/events/ps3sdl/ps3sdl-events.h b/backends/events/ps3sdl/ps3sdl-events.h index d28ce7fcf8..340af49102 100644 --- a/backends/events/ps3sdl/ps3sdl-events.h +++ b/backends/events/ps3sdl/ps3sdl-events.h @@ -31,8 +31,6 @@ class PS3SdlEventSource : public SdlEventSource { protected: void preprocessEvents(SDL_Event *event); - bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event); - bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event); }; #endif /* BACKEND_EVENTS_PS3_H */ -- cgit v1.2.3