aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/gp2x/gp2x-common.h
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/gp2x/gp2x-common.h')
-rw-r--r--backends/platform/gp2x/gp2x-common.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h
index b54e2d4d4f..1c8708a8b1 100644
--- a/backends/platform/gp2x/gp2x-common.h
+++ b/backends/platform/gp2x/gp2x-common.h
@@ -113,6 +113,24 @@ public:
// Sets up the keymapper with the backends hardware key set
void setupKeymapper();
+protected:
+ virtual bool dispatchSDLEvent(SDL_Event &ev, Common::Event &event);
+
+ // Handlers for specific SDL events, called by pollEvent.
+ // This way, if a backend inherits fromt the SDL backend, it can
+ // change the behavior of only a single event, without having to override all
+ // of pollEvent.
+ virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event);
+ virtual bool handleKeyUp(SDL_Event &ev, Common::Event &event);
+ virtual bool handleMouseMotion(SDL_Event &ev, Common::Event &event);
+ virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event);
+ virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event);
+ virtual bool handleJoyButtonDown(SDL_Event &ev, Common::Event &event);
+ virtual bool handleJoyButtonUp(SDL_Event &ev, Common::Event &event);
+ virtual bool handleJoyAxisMotion(SDL_Event &ev, Common::Event &event);
+
+public:
+
// Set function that generates samples
void setupMixer();
static void mixCallback(void *s, byte *samples, int len);
@@ -153,6 +171,7 @@ public:
bool hasFeature(Feature f);
void setFeatureState(Feature f, bool enable);
bool getFeatureState(Feature f);
+ void preprocessEvents(SDL_Event *event) {}
void displayMessageOnOSD(const char *msg);
@@ -297,6 +316,9 @@ protected:
kMouseColorKey = 1
};
+ // Scroll lock state - since SDL doesn't track it
+ bool _scrollLock;
+
// joystick
SDL_Joystick *_joystick;
bool _stickBtn[32];
@@ -374,7 +396,8 @@ protected:
virtual bool remapKey(SDL_Event &ev, Common::Event &event);
- void handleScalerHotkeys(const SDL_KeyboardEvent &key);
+ bool handleScalerHotkeys(const SDL_KeyboardEvent &key);
+ bool isScalerHotkey(const Common::Event &event);
void moveStick();
int _gp2xInputType;