From: Daniel Karbach Date: Mon, 21 Jan 2013 13:10:42 +0000 (-0600) Subject: added key mapping for pandora X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=273ffc5020b509e7be9ec7f201b6b1ba0cc4709a;p=l2e.git added key mapping for pandora --- diff --git a/readme b/readme index ff710ac..9dbe8e1 100644 --- a/readme +++ b/readme @@ -65,6 +65,8 @@ Control Mapping right : right shift | debug 3 : 3 left : left shift | debug 4 : 4 + This mapping is defined in `src/keys.h'. + More There is a project page online with issue tracker and wiki at `http://luke.redirectme.net/redmine/projects/l2e'. diff --git a/src/keys.h b/src/keys.h index 66836ba..cf1059b 100644 --- a/src/keys.h +++ b/src/keys.h @@ -2,8 +2,23 @@ #define L2E_KEYS_H_ #include "app/Input.h" +#include inline void MapKeys(app::Input &input) { +#ifdef PANDORA + input.MapKey(SDLK_UP, app::Input::PAD_UP); + input.MapKey(SDLK_RIGHT, app::Input::PAD_RIGHT); + input.MapKey(SDLK_DOWN, app::Input::PAD_DOWN); + input.MapKey(SDLK_LEFT, app::Input::PAD_LEFT); + input.MapKey(SDLK_END, app::Input::ACTION_A); + input.MapKey(SDLK_PAGEDOWN, app::Input::ACTION_B); + input.MapKey(SDLK_PAGEUP, app::Input::ACTION_X); + input.MapKey(SDLK_HOME, app::Input::ACTION_Y); + input.MapKey(SDLK_RALT, app::Input::START); + input.MapKey(SDLK_RCTRL, app::Input::SELECT); + input.MapKey(SDLK_LCTRL, app::Input::SHOULDER_RIGHT); + input.MapKey(SDLK_LSHIFT, app::Input::SHOULDER_LEFT); +#else input.MapKey(SDLK_w, app::Input::PAD_UP); input.MapKey(SDLK_d, app::Input::PAD_RIGHT); input.MapKey(SDLK_s, app::Input::PAD_DOWN); @@ -16,6 +31,7 @@ inline void MapKeys(app::Input &input) { input.MapKey(SDLK_SPACE, app::Input::SELECT); input.MapKey(SDLK_RSHIFT, app::Input::SHOULDER_RIGHT); input.MapKey(SDLK_LSHIFT, app::Input::SHOULDER_LEFT); +#endif input.MapKey(SDLK_1, app::Input::DEBUG_1); input.MapKey(SDLK_2, app::Input::DEBUG_2);