Formatting

svn-id: r43675
This commit is contained in:
Eugene Sandulenko 2009-08-23 20:40:09 +00:00
parent cf7116710b
commit 080eaef76c
2 changed files with 41 additions and 39 deletions

View file

@ -42,23 +42,23 @@ struct Key {
};
static const Key keys[] = {
{"FIRE", KEYCODE_RETURN, ASCII_RETURN, "Fire", kActionKeyType, false},
{"CAMERA", KEYCODE_PAUSE, 0, "Camera", kActionKeyType, false},
{"HANGUP", KEYCODE_ESCAPE, ASCII_ESCAPE, "Hangup", kStartKeyType, false},
{"CALL", KEYCODE_SPACE, ASCII_SPACE, "Call", kActionKeyType, false},
{"PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false},
{"MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false},
{ "FIRE", KEYCODE_RETURN, ASCII_RETURN, "Fire", kActionKeyType, false },
{ "CAMERA", KEYCODE_PAUSE, 0, "Camera", kActionKeyType, false },
{ "HANGUP", KEYCODE_ESCAPE, ASCII_ESCAPE, "Hangup", kStartKeyType, false },
{ "CALL", KEYCODE_SPACE, ASCII_SPACE, "Call", kActionKeyType, false },
{ "PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false },
{ "MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false },
{"a", KEYCODE_a, 'a', "a", kActionKeyType, true},
{"b", KEYCODE_b, 'b', "b", kActionKeyType, true},
{"c", KEYCODE_c, 'c', "c", kActionKeyType, true},
{"d", KEYCODE_d, 'd', "d", kActionKeyType, true},
{"e", KEYCODE_e, 'e', "e", kActionKeyType, true},
{"f", KEYCODE_f, 'f', "f", kActionKeyType, true},
{"g", KEYCODE_g, 'g', "g", kActionKeyType, true},
{"h", KEYCODE_h, 'h', "h", kActionKeyType, true},
{"i", KEYCODE_i, 'i', "i", kActionKeyType, true},
{"j", KEYCODE_j, 'j', "j", kActionKeyType, true},
{ "a", KEYCODE_a, 'a', "a", kActionKeyType, true },
{ "b", KEYCODE_b, 'b', "b", kActionKeyType, true },
{ "c", KEYCODE_c, 'c', "c", kActionKeyType, true },
{ "d", KEYCODE_d, 'd', "d", kActionKeyType, true },
{ "e", KEYCODE_e, 'e', "e", kActionKeyType, true },
{ "f", KEYCODE_f, 'f', "f", kActionKeyType, true },
{ "g", KEYCODE_g, 'g', "g", kActionKeyType, true },
{ "h", KEYCODE_h, 'h', "h", kActionKeyType, true },
{ "i", KEYCODE_i, 'i', "i", kActionKeyType, true },
{ "j", KEYCODE_j, 'j', "j", kActionKeyType, true },
// Numeric keypad

View file

@ -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);