aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/linuxmoto/linuxmoto-events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/linuxmoto/linuxmoto-events.cpp')
-rw-r--r--backends/platform/linuxmoto/linuxmoto-events.cpp48
1 files changed, 25 insertions, 23 deletions
diff --git a/backends/platform/linuxmoto/linuxmoto-events.cpp b/backends/platform/linuxmoto/linuxmoto-events.cpp
index 2a40d734b0..be5eec5c7e 100644
--- a/backends/platform/linuxmoto/linuxmoto-events.cpp
+++ b/backends/platform/linuxmoto/linuxmoto-events.cpp
@@ -53,20 +53,20 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
return true;
}
// '1' Bypass security protection - MOD+Call key
- if (ev.key.keysym.sym == SDLK_f) {
- ev.key.keysym.sym=SDLK_1;
+ if (ev.key.keysym.sym == SDLK_f) {
+ ev.key.keysym.sym = SDLK_1;
}
// F5 Game Menu - Call key
else if (ev.key.keysym.sym == SDLK_SPACE) {
- ev.key.keysym.sym=SDLK_F5;
+ ev.key.keysym.sym = SDLK_F5;
}
// Camera to VirtualKeyboard
else if (ev.key.keysym.sym == SDLK_PAUSE) {
- ev.key.keysym.sym=SDLK_F7;
+ ev.key.keysym.sym = SDLK_F7;
}
// mod+fire to enter
else if (ev.key.keysym.sym == SDLK_b) {
- ev.key.keysym.sym=SDLK_RETURN;
+ ev.key.keysym.sym = SDLK_RETURN;
}
#endif
// Motorola Z6/V8 remapkey by Ant-On
@@ -78,17 +78,17 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
} else
// F5 Game Menu - Call key
if (ev.key.keysym.sym == SDLK_SPACE) {
- ev.key.keysym.sym=SDLK_F5;
+ ev.key.keysym.sym = SDLK_F5;
}
// 'y' - Mod+Right key
// 'y' - Left soft
else if (ev.key.keysym.sym == SDLK_F9) {
- ev.key.keysym.sym=SDLK_y;
+ ev.key.keysym.sym = SDLK_y;
}
// 'n' - Mod+Left key
// 'n' - rigth soft
else if (ev.key.keysym.sym == SDLK_F11) {
- ev.key.keysym.sym=SDLK_n;
+ ev.key.keysym.sym = SDLK_n;
}
#endif
@@ -116,6 +116,7 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MOUSEMOVE;
fillMouseEvent(event, _km.x, _km.y);
+
return true;
} else if (ev.key.keysym.sym == SDLK_DOWN) {
if (ev.type == SDL_KEYDOWN) {
@@ -128,6 +129,7 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MOUSEMOVE;
fillMouseEvent(event, _km.x, _km.y);
+
return true;
} else if (ev.key.keysym.sym == SDLK_UP) {
if (ev.type == SDL_KEYDOWN) {
@@ -140,47 +142,47 @@ bool OSystem_LINUXMOTO::remapKey(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MOUSEMOVE;
fillMouseEvent(event, _km.x, _km.y);
+
return true;
- }
- // Joystick center to pressing Left Mouse
- else if (ev.key.keysym.sym == SDLK_RETURN) {
+ } else if (ev.key.keysym.sym == SDLK_RETURN) { // Joystick center to pressing Left Mouse
// _km.y_vel = 0;
// _km.y_down_count = 0;
if (ev.key.type == SDL_KEYDOWN) {
event.type = Common::EVENT_LBUTTONDOWN;
} else {
- event.type = Common::EVENT_LBUTTONUP;
+ event.type = Common::EVENT_LBUTTONUP;
}
+
fillMouseEvent(event, _km.x, _km.y);
+
return true;
- }
- // Volume Up to pressing Right Mouse
- else if (ev.key.keysym.sym == SDLK_PLUS) {
+ } else if (ev.key.keysym.sym == SDLK_PLUS) { // Volume Up to pressing Right Mouse
// _km.y_vel = 0;
// _km.y_down_count = 0;
if (ev.key.type == SDL_KEYDOWN ) {
event.type = Common::EVENT_RBUTTONDOWN;
} else {
- event.type = Common::EVENT_RBUTTONUP;
+ event.type = Common::EVENT_RBUTTONUP;
}
fillMouseEvent(event, _km.x, _km.y);
+
return true;
- }
- // Volume Down to pressing Left Mouse
- else if (ev.key.keysym.sym == SDLK_MINUS) {
+ } else if (ev.key.keysym.sym == SDLK_MINUS) { // Volume Down to pressing Left Mouse
//_km.y_vel = 0;
//_km.y_down_count = 0;
if (ev.key.type == SDL_KEYDOWN) {
event.type = Common::EVENT_LBUTTONDOWN;
} else {
- event.type = Common::EVENT_LBUTTONUP;
+ event.type = Common::EVENT_LBUTTONUP;
}
+
fillMouseEvent(event, _km.x, _km.y);
+
return true;
} else {
- // Let the events fall through if we didn't change them, this may not be the best way to
- // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though.
- // and yes i have an huge terminal size so i dont wrap soon enough.
+ // Let the events fall through if we didn't change them, this may not be the best way to
+ // set it up, but i'm not sure how sdl would like it if we let if fall through then redid it though.
+ // and yes i have an huge terminal size so i dont wrap soon enough.
event.type = Common::EVENT_KEYDOWN;
event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);