From 70b7ebb33901d3dff5426c1c2fa12bc5087b721a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 22 Aug 2009 12:35:49 +0000 Subject: Patch #2826508: "Motorola A1200/E6/A1600 (motoezx) patch" svn-id: r43636 --- backends/platform/linuxmoto/hardwarekeys.cpp | 100 +++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 backends/platform/linuxmoto/hardwarekeys.cpp (limited to 'backends/platform/linuxmoto/hardwarekeys.cpp') diff --git a/backends/platform/linuxmoto/hardwarekeys.cpp b/backends/platform/linuxmoto/hardwarekeys.cpp new file mode 100644 index 0000000000..2f64e7dbae --- /dev/null +++ b/backends/platform/linuxmoto/hardwarekeys.cpp @@ -0,0 +1,100 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + + +#include "backends/platform/linuxmoto/linuxmoto-sdl.h" +#include "backends/keymapper/keymapper.h" +#include "common/keyboard.h" + +#ifdef ENABLE_KEYMAPPER + +using namespace Common; + +struct Key { + const char *hwId; + KeyCode keycode; + uint16 ascii; + const char *desc; + KeyType preferredAction; + bool shiftable; +}; + +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}, + + {"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 + + // Arrows + Home/End pad + {"UP", KEYCODE_UP, 0, "Up", kDirUpKeyType, false}, + {"DOWN", KEYCODE_DOWN, 0, "Down", kDirDownKeyType, false}, + {"RIGHT", KEYCODE_RIGHT, 0, "Right", kDirRightKeyType, false}, + {"LEFT", KEYCODE_LEFT, 0, "Left", kDirLeftKeyType, false}, + + // Function keys + + // Miscellaneous function keys + + {0, KEYCODE_INVALID, 0, 0, kGenericKeyType, false} +}; + +struct Mod { + byte flag; + const char *id; + const char *desc; + bool shiftable; +}; + +static const Mod modifiers[] = { + { 0, "", "", false }, + { KBD_CTRL, "C+", "Ctrl+", false }, + { KBD_ALT, "A+", "Alt+", false }, + { KBD_SHIFT, "", "", true }, + { KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", false }, + { KBD_SHIFT | KBD_CTRL, "S+C+", "Shift+Ctrl+", true }, + { KBD_SHIFT | KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", true }, + { 0, 0, 0, false } +}; +#endif + + +Common::HardwareKeySet *OSystem_LINUXMOTO::getHardwareKeySet() { + OSystem_SDL::getHardwareKeySet(); +} -- cgit v1.2.3 From 080eaef76cb4051802a41c58155f7bb004ab9d1a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 23 Aug 2009 20:40:09 +0000 Subject: Formatting svn-id: r43675 --- backends/platform/linuxmoto/hardwarekeys.cpp | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'backends/platform/linuxmoto/hardwarekeys.cpp') diff --git a/backends/platform/linuxmoto/hardwarekeys.cpp b/backends/platform/linuxmoto/hardwarekeys.cpp index 2f64e7dbae..e65d2bec2b 100644 --- a/backends/platform/linuxmoto/hardwarekeys.cpp +++ b/backends/platform/linuxmoto/hardwarekeys.cpp @@ -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}, - - {"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}, + { "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 }, // Numeric keypad -- cgit v1.2.3