[Scummvm-cvs-logs] scummvm master -> 657206bc5b840006ea9f98767ade937f9fc0fab0

tsoliman tarek at bashasoliman.com
Tue Feb 28 14:43:24 CET 2012


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4d1e6c3d54 KEYMAPPER: Move HardwareInputSet implementation out of header file
477c1b9a87 KEYMAPPER: HardwareInputSet now has defaults
657206bc5b MAEMO: Define only special keys to Keymapper


Commit: 4d1e6c3d54fc692697144ebe2d4799fa67f30203
    https://github.com/scummvm/scummvm/commit/4d1e6c3d54fc692697144ebe2d4799fa67f30203
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2012-02-28T04:34:19-08:00

Commit Message:
KEYMAPPER: Move HardwareInputSet implementation out of header file

Changed paths:
  A backends/keymapper/hardware-input.cpp
    backends/keymapper/hardware-input.h
    backends/module.mk



diff --git a/backends/keymapper/hardware-input.cpp b/backends/keymapper/hardware-input.cpp
new file mode 100644
index 0000000..801c77f
--- /dev/null
+++ b/backends/keymapper/hardware-input.cpp
@@ -0,0 +1,109 @@
+/* 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.
+*
+*/
+
+#include "backends/keymapper/hardware-input.h"
+
+#ifdef ENABLE_KEYMAPPER
+
+#include "backends/keymapper/keymapper.h"
+
+namespace Common {
+
+HardwareInputSet::HardwareInputSet(const KeyTableEntry *keys, const ModifierTableEntry *modifiers) {
+	addHardwareInputs(keys, modifiers);
+}
+
+HardwareInputSet::~HardwareInputSet() {
+	List<const HardwareInput *>::const_iterator it;
+
+	for (it = _inputs.begin(); it != _inputs.end(); it++)
+		delete *it;
+}
+
+void HardwareInputSet::addHardwareInput(const HardwareInput *input) {
+	checkForInput(input);
+	_inputs.push_back(input);
+}
+
+const HardwareInput *HardwareInputSet::findHardwareInput(String id) const {
+	List<const HardwareInput *>::const_iterator it;
+
+	for (it = _inputs.begin(); it != _inputs.end(); it++) {
+		if ((*it)->id == id)
+			return (*it);
+	}
+	return 0;
+}
+
+const HardwareInput *HardwareInputSet::findHardwareInput(const KeyState& keystate) const {
+	List<const HardwareInput *>::const_iterator it;
+
+	for (it = _inputs.begin(); it != _inputs.end(); it++) {
+		if ((*it)->key == keystate)
+			return (*it);
+	}
+	return 0;
+}
+
+void HardwareInputSet::addHardwareInputs(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]) {
+	const KeyTableEntry *key;
+	const ModifierTableEntry *mod;
+	char fullKeyId[50];
+	char fullKeyDesc[100];
+	uint16 ascii;
+
+	for (mod = modifiers; mod->id; mod++) {
+		for (key = keys; key->hwId; key++) {
+			ascii = key->ascii;
+
+			if (mod->shiftable && key->shiftable) {
+				snprintf(fullKeyId, 50, "%s%c", mod->id, toupper(key->hwId[0]));
+				snprintf(fullKeyDesc, 100, "%s%c", mod->desc, toupper(key->desc[0]));
+				ascii = toupper(key->ascii);
+			} else if (mod->shiftable) {
+				snprintf(fullKeyId, 50, "S+%s%s", mod->id, key->hwId);
+				snprintf(fullKeyDesc, 100, "Shift+%s%s", mod->desc, key->desc);
+			} else {
+				snprintf(fullKeyId, 50, "%s%s", mod->id, key->hwId);
+				snprintf(fullKeyDesc, 100, "%s%s", mod->desc, key->desc);
+			}
+
+			addHardwareInput(new HardwareInput(fullKeyId, KeyState(key->keycode, ascii, mod->flag), fullKeyDesc));
+		}
+	}
+}
+
+void HardwareInputSet::checkForInput(const HardwareInput *input) {
+	List<const HardwareInput *>::iterator it;
+
+	for (it = _inputs.begin(); it != _inputs.end(); it++) {
+		if ((*it)->id == input->id)
+			error("Error adding HardwareInput '%s' - id of %s already in use!", input->description.c_str(), input->id.c_str());
+		else if ((*it)->key == input->key)
+			error("Error adding HardwareInput '%s' - key already in use!", input->description.c_str());
+	}
+}
+
+} //namespace Common
+
+#endif // #ifdef ENABLE_KEYMAPPER
+
diff --git a/backends/keymapper/hardware-input.h b/backends/keymapper/hardware-input.h
index 70e0f98..eb165e7 100644
--- a/backends/keymapper/hardware-input.h
+++ b/backends/keymapper/hardware-input.h
@@ -27,6 +27,9 @@
 
 #ifdef ENABLE_KEYMAPPER
 
+#include "common/keyboard.h"
+#include "common/list.h"
+#include "common/str.h"
 #include "common/textconsole.h"
 
 namespace Common {
@@ -85,43 +88,17 @@ public:
 	 * @param keys       table of available keys
 	 * @param modifiers  table of available modifiers
 	 */
-	HardwareInputSet(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]) {
-		addHardwareInputs(keys, modifiers);
-	}
+	HardwareInputSet(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]);
 
 	HardwareInputSet() { }
 
-	virtual ~HardwareInputSet() {
-		List<const HardwareInput *>::const_iterator it;
-
-		for (it = _inputs.begin(); it != _inputs.end(); it++)
-			delete *it;
-	}
-
-	void addHardwareInput(const HardwareInput *input) {
-		checkForInput(input);
-		_inputs.push_back(input);
-	}
+	virtual ~HardwareInputSet();
 
-	const HardwareInput *findHardwareInput(String id) const {
-		List<const HardwareInput *>::const_iterator it;
+	void addHardwareInput(const HardwareInput *input);
 
-		for (it = _inputs.begin(); it != _inputs.end(); it++) {
-			if ((*it)->id == id)
-				return (*it);
-		}
-		return 0;
-	}
+	const HardwareInput *findHardwareInput(String id) const;
 
-	const HardwareInput *findHardwareInput(const KeyState& keystate) const {
-		List<const HardwareInput *>::const_iterator it;
-
-		for (it = _inputs.begin(); it != _inputs.end(); it++) {
-			if ((*it)->key == keystate)
-				return (*it);
-		}
-		return 0;
-	}
+	const HardwareInput *findHardwareInput(const KeyState& keystate) const;
 
 	const List<const HardwareInput *> &getHardwareInputs() const {
 		return _inputs;
@@ -136,46 +113,11 @@ public:
 	 * @param keys       table of available keys
 	 * @param modifiers  table of available modifiers
 	 */
-	void addHardwareInputs(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]) {
-		const KeyTableEntry *key;
-		const ModifierTableEntry *mod;
-		char fullKeyId[50];
-		char fullKeyDesc[100];
-		uint16 ascii;
-
-		for (mod = modifiers; mod->id; mod++) {
-			for (key = keys; key->hwId; key++) {
-				ascii = key->ascii;
-
-				if (mod->shiftable && key->shiftable) {
-					snprintf(fullKeyId, 50, "%s%c", mod->id, toupper(key->hwId[0]));
-					snprintf(fullKeyDesc, 100, "%s%c", mod->desc, toupper(key->desc[0]));
-					ascii = toupper(key->ascii);
-				} else if (mod->shiftable) {
-					snprintf(fullKeyId, 50, "S+%s%s", mod->id, key->hwId);
-					snprintf(fullKeyDesc, 100, "Shift+%s%s", mod->desc, key->desc);
-				} else {
-					snprintf(fullKeyId, 50, "%s%s", mod->id, key->hwId);
-					snprintf(fullKeyDesc, 100, "%s%s", mod->desc, key->desc);
-				}
-
-				addHardwareInput(new HardwareInput(fullKeyId, KeyState(key->keycode, ascii, mod->flag), fullKeyDesc));
-			}
-		}
-	}
+	void addHardwareInputs(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]);
 
 private:
 
-	void checkForInput(const HardwareInput *input) {
-		List<const HardwareInput *>::iterator it;
-
-		for (it = _inputs.begin(); it != _inputs.end(); it++) {
-			if ((*it)->id == input->id)
-				error("Error adding HardwareInput '%s' - id of %s already in use!", input->description.c_str(), input->id.c_str());
-			else if ((*it)->key == input->key)
-				error("Error adding HardwareInput '%s' - key already in use!", input->description.c_str());
-		}
-	}
+	void checkForInput(const HardwareInput *input);
 
 	List<const HardwareInput *> _inputs;
 };
diff --git a/backends/module.mk b/backends/module.mk
index 37209ff..95725d9 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -33,6 +33,7 @@ endif
 ifdef ENABLE_KEYMAPPER
 MODULE_OBJS += \
 	keymapper/action.o \
+	keymapper/hardware-input.o \
 	keymapper/keymap.o \
 	keymapper/keymapper.o \
 	keymapper/remap-dialog.o


Commit: 477c1b9a87046f17c165e66f566d91d0906a8fcd
    https://github.com/scummvm/scummvm/commit/477c1b9a87046f17c165e66f566d91d0906a8fcd
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2012-02-28T04:45:35-08:00

Commit Message:
KEYMAPPER: HardwareInputSet now has defaults

Ports can add additional special keys.
SDL no longer carries the static tables.
Default behavior unchanged: HardwareInputSet() still gives an empty one.

Changed paths:
  R backends/platform/sdl/hardwarekeys.cpp
    backends/keymapper/hardware-input.cpp
    backends/keymapper/hardware-input.h
    backends/keymapper/keymapper.cpp
    backends/platform/maemo/maemo.cpp
    backends/platform/sdl/module.mk
    backends/platform/sdl/sdl.h



diff --git a/backends/keymapper/hardware-input.cpp b/backends/keymapper/hardware-input.cpp
index 801c77f..a09f0b5 100644
--- a/backends/keymapper/hardware-input.cpp
+++ b/backends/keymapper/hardware-input.cpp
@@ -28,26 +28,181 @@
 
 namespace Common {
 
-HardwareInputSet::HardwareInputSet(const KeyTableEntry *keys, const ModifierTableEntry *modifiers) {
-	addHardwareInputs(keys, modifiers);
+static const KeyTableEntry defaultKeys[] = {
+	{"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", false},
+	{"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", false},
+	{"CLEAR", KEYCODE_CLEAR, 0, "Clear", false},
+	{"RETURN", KEYCODE_RETURN, ASCII_RETURN, "Return", false},
+	{"PAUSE", KEYCODE_PAUSE, 0, "Pause", false},
+	{"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", false},
+	{"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", false},
+	{"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", false},
+	{"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", false},
+	{"HASH", KEYCODE_HASH, '#', "#", false},
+	{"DOLLAR", KEYCODE_DOLLAR, '$', "$", false},
+	{"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", false},
+	{"QUOTE", KEYCODE_QUOTE, '\'', "'", false},
+	{"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", false},
+	{"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", false},
+	{"ASTERISK", KEYCODE_ASTERISK, '*', "*", false},
+	{"PLUS", KEYCODE_PLUS, '+', "+", false},
+	{"COMMA", KEYCODE_COMMA, ',', ",", false},
+	{"MINUS", KEYCODE_MINUS, '-', "-", false},
+	{"PERIOD", KEYCODE_PERIOD, '.', ".", false},
+	{"SLASH", KEYCODE_SLASH, '/', "/", false},
+	{"0", KEYCODE_0, '0', "0", false},
+	{"1", KEYCODE_1, '1', "1", false},
+	{"2", KEYCODE_2, '2', "2", false},
+	{"3", KEYCODE_3, '3', "3", false},
+	{"4", KEYCODE_4, '4', "4", false},
+	{"5", KEYCODE_5, '5', "5", false},
+	{"6", KEYCODE_6, '6', "6", false},
+	{"7", KEYCODE_7, '7', "7", false},
+	{"8", KEYCODE_8, '8', "8", false},
+	{"9", KEYCODE_9, '9', "9", false},
+	{"COLON", KEYCODE_COLON, ':', ":", false},
+	{"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", false},
+	{"LESS", KEYCODE_LESS, '<', "<", false},
+	{"EQUALS", KEYCODE_EQUALS, '=', "=", false},
+	{"GREATER", KEYCODE_GREATER, '>', ">", false},
+	{"QUESTION", KEYCODE_QUESTION, '?', "?", false},
+	{"AT", KEYCODE_AT, '@', "@", false},
+
+	{"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", false},
+	{"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", false},
+	{"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", false},
+	{"CARET", KEYCODE_CARET, '^', "^", false},
+	{"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", false},
+	{"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", false},
+	{"a", KEYCODE_a, 'a', "a", true},
+	{"b", KEYCODE_b, 'b', "b", true},
+	{"c", KEYCODE_c, 'c', "c", true},
+	{"d", KEYCODE_d, 'd', "d", true},
+	{"e", KEYCODE_e, 'e', "e", true},
+	{"f", KEYCODE_f, 'f', "f", true},
+	{"g", KEYCODE_g, 'g', "g", true},
+	{"h", KEYCODE_h, 'h', "h", true},
+	{"i", KEYCODE_i, 'i', "i", true},
+	{"j", KEYCODE_j, 'j', "j", true},
+	{"k", KEYCODE_k, 'k', "k", true},
+	{"l", KEYCODE_l, 'l', "l", true},
+	{"m", KEYCODE_m, 'm', "m", true},
+	{"n", KEYCODE_n, 'n', "n", true},
+	{"o", KEYCODE_o, 'o', "o", true},
+	{"p", KEYCODE_p, 'p', "p", true},
+	{"q", KEYCODE_q, 'q', "q", true},
+	{"r", KEYCODE_r, 'r', "r", true},
+	{"s", KEYCODE_s, 's', "s", true},
+	{"t", KEYCODE_t, 't', "t", true},
+	{"u", KEYCODE_u, 'u', "u", true},
+	{"v", KEYCODE_v, 'v', "v", true},
+	{"w", KEYCODE_w, 'w', "w", true},
+	{"x", KEYCODE_x, 'x', "x", true},
+	{"y", KEYCODE_y, 'y', "y", true},
+	{"z", KEYCODE_z, 'z', "z", true},
+	{"DELETE", KEYCODE_DELETE, 0, "Del", false},
+
+	// Numeric keypad
+	{"KP0", KEYCODE_KP0, 0, "KP0", false},
+	{"KP1", KEYCODE_KP1, 0, "KP1", false},
+	{"KP2", KEYCODE_KP2, 0, "KP2", false},
+	{"KP3", KEYCODE_KP3, 0, "KP3", false},
+	{"KP4", KEYCODE_KP4, 0, "KP4", false},
+	{"KP5", KEYCODE_KP5, 0, "KP5", false},
+	{"KP6", KEYCODE_KP6, 0, "KP6", false},
+	{"KP7", KEYCODE_KP7, 0, "KP7", false},
+	{"KP8", KEYCODE_KP8, 0, "KP8", false},
+	{"KP9", KEYCODE_KP9, 0, "KP9", false},
+	{"KP_PERIOD", KEYCODE_KP_PERIOD, 0, "KP.", false},
+	{"KP_DIVIDE", KEYCODE_KP_DIVIDE, 0, "KP/", false},
+	{"KP_MULTIPLY", KEYCODE_KP_MULTIPLY, 0, "KP*", false},
+	{"KP_MINUS", KEYCODE_KP_MINUS, 0, "KP-", false},
+	{"KP_PLUS", KEYCODE_KP_PLUS, 0, "KP+", false},
+	{"KP_ENTER", KEYCODE_KP_ENTER, 0, "KP Enter", false},
+	{"KP_EQUALS", KEYCODE_KP_EQUALS, 0, "KP=", false},
+
+	// Arrows + Home/End pad
+	{"UP", KEYCODE_UP, 0, "Up", false},
+	{"DOWN", KEYCODE_DOWN, 0, "Down", false},
+	{"RIGHT", KEYCODE_RIGHT, 0, "Right", false},
+	{"LEFT", KEYCODE_LEFT, 0, "Left", false},
+	{"INSERT", KEYCODE_INSERT, 0, "Insert", false},
+	{"HOME", KEYCODE_HOME, 0, "Home", false},
+	{"END", KEYCODE_END, 0, "End", false},
+	{"PAGEUP", KEYCODE_PAGEUP, 0, "PgUp", false},
+	{"PAGEDOWN", KEYCODE_PAGEDOWN, 0, "PgDn", false},
+
+	// Function keys
+	{"F1", KEYCODE_F1, ASCII_F1, "F1", false},
+	{"F2", KEYCODE_F2, ASCII_F2, "F2", false},
+	{"F3", KEYCODE_F3, ASCII_F3, "F3", false},
+	{"F4", KEYCODE_F4, ASCII_F4, "F4", false},
+	{"F5", KEYCODE_F5, ASCII_F5, "F5", false},
+	{"F6", KEYCODE_F6, ASCII_F6, "F6", false},
+	{"F7", KEYCODE_F7, ASCII_F7, "F7", false},
+	{"F8", KEYCODE_F8, ASCII_F8, "F8", false},
+	{"F9", KEYCODE_F9, ASCII_F9, "F9", false},
+	{"F10", KEYCODE_F10, ASCII_F10, "F10", false},
+	{"F11", KEYCODE_F11, ASCII_F11, "F11", false},
+	{"F12", KEYCODE_F12, ASCII_F12, "F12", false},
+	{"F13", KEYCODE_F13, 0, "F13", false},
+	{"F14", KEYCODE_F14, 0, "F14", false},
+	{"F15", KEYCODE_F15, 0, "F15", false},
+
+	// Miscellaneous function keys
+	{"HELP", KEYCODE_HELP, 0, "Help", false},
+	{"PRINT", KEYCODE_PRINT, 0, "Print", false},
+	{"SYSREQ", KEYCODE_SYSREQ, 0, "SysRq", false},
+	{"BREAK", KEYCODE_BREAK, 0, "Break", false},
+	{"MENU", KEYCODE_MENU, 0, "Menu", false},
+		// Power Macintosh power key
+	{"POWER", KEYCODE_POWER, 0, "Power", false},
+		// Some european keyboards
+	{"EURO", KEYCODE_EURO, 0, "Euro", false},
+		// Atari keyboard has Undo
+	{"UNDO", KEYCODE_UNDO, 0, "Undo", false},
+	{0, KEYCODE_INVALID, 0, 0, false}
+};
+
+static const ModifierTableEntry defaultModifiers[] = {
+	{ 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 }
+};
+
+HardwareInputSet::HardwareInputSet(bool useDefault, const KeyTableEntry *keys, const ModifierTableEntry *modifiers) {
+	if (useDefault)
+		addHardwareInputs(defaultKeys, defaultModifiers);
+	if (keys)
+		addHardwareInputs(keys, modifiers ? modifiers : defaultModifiers);
 }
 
 HardwareInputSet::~HardwareInputSet() {
 	List<const HardwareInput *>::const_iterator it;
 
-	for (it = _inputs.begin(); it != _inputs.end(); it++)
+	for (it = _inputs.begin(); it != _inputs.end(); ++it)
 		delete *it;
 }
 
 void HardwareInputSet::addHardwareInput(const HardwareInput *input) {
-	checkForInput(input);
+	assert(input);
+
+	debug(8, "Adding hardware input [%s][%s]", input->id.c_str(), input->description.c_str());
+
+	removeHardwareInput(input);
+
 	_inputs.push_back(input);
 }
 
 const HardwareInput *HardwareInputSet::findHardwareInput(String id) const {
 	List<const HardwareInput *>::const_iterator it;
 
-	for (it = _inputs.begin(); it != _inputs.end(); it++) {
+	for (it = _inputs.begin(); it != _inputs.end(); ++it) {
 		if ((*it)->id == id)
 			return (*it);
 	}
@@ -57,7 +212,7 @@ const HardwareInput *HardwareInputSet::findHardwareInput(String id) const {
 const HardwareInput *HardwareInputSet::findHardwareInput(const KeyState& keystate) const {
 	List<const HardwareInput *>::const_iterator it;
 
-	for (it = _inputs.begin(); it != _inputs.end(); it++) {
+	for (it = _inputs.begin(); it != _inputs.end(); ++it) {
 		if ((*it)->key == keystate)
 			return (*it);
 	}
@@ -92,14 +247,23 @@ void HardwareInputSet::addHardwareInputs(const KeyTableEntry keys[], const Modif
 	}
 }
 
-void HardwareInputSet::checkForInput(const HardwareInput *input) {
+void HardwareInputSet::addHardwareInputs(const KeyTableEntry keys[]) {
+	addHardwareInputs(keys, defaultModifiers);
+}
+
+void HardwareInputSet::removeHardwareInput(const HardwareInput *input) {
+	if (!input)
+		return;
+
 	List<const HardwareInput *>::iterator it;
 
-	for (it = _inputs.begin(); it != _inputs.end(); it++) {
-		if ((*it)->id == input->id)
-			error("Error adding HardwareInput '%s' - id of %s already in use!", input->description.c_str(), input->id.c_str());
-		else if ((*it)->key == input->key)
-			error("Error adding HardwareInput '%s' - key already in use!", input->description.c_str());
+	for (it = _inputs.begin(); it != _inputs.end(); ++it) {
+		const HardwareInput *entry = (*it);
+		if (entry->id == input->id || entry->key == input->key) {
+			debug(7, "Removing hardware input [%s] (%s) because it matches [%s] (%s)", entry->id.c_str(), entry->description.c_str(), input->id.c_str(), input->description.c_str());
+			delete entry;
+			_inputs.erase(it);
+		}
 	}
 }
 
diff --git a/backends/keymapper/hardware-input.h b/backends/keymapper/hardware-input.h
index eb165e7..9396765 100644
--- a/backends/keymapper/hardware-input.h
+++ b/backends/keymapper/hardware-input.h
@@ -85,12 +85,11 @@ public:
 
 	/**
 	 * Add hardware input keys to the set out of key and modifier tables.
-	 * @param keys       table of available keys
-	 * @param modifiers  table of available modifiers
+	 * @param useDefault	auto-add the built-in default inputs
+	 * @param keys       	table of available keys
+	 * @param modifiers  	table of available modifiers
 	 */
-	HardwareInputSet(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]);
-
-	HardwareInputSet() { }
+	HardwareInputSet(bool useDefault = false, const KeyTableEntry keys[] = 0, const ModifierTableEntry modifiers[] = 0);
 
 	virtual ~HardwareInputSet();
 
@@ -100,13 +99,9 @@ public:
 
 	const HardwareInput *findHardwareInput(const KeyState& keystate) const;
 
-	const List<const HardwareInput *> &getHardwareInputs() const {
-		return _inputs;
-	}
+	const List<const HardwareInput *> &getHardwareInputs() const { return _inputs; }
 
-	uint size() const {
-		return _inputs.size();
-	}
+	uint size() const { return _inputs.size(); }
 
 	/**
 	 * Add hardware inputs to the set out of key and modifier tables.
@@ -115,9 +110,16 @@ public:
 	 */
 	void addHardwareInputs(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]);
 
-private:
+	/**
+	 * Add hardware inputs to the set out of a key table.
+	 * The default modifiers are applied to the key entries
+	 * @param keys       table of available keys
+	 */
+	void addHardwareInputs(const KeyTableEntry keys[]);
 
-	void checkForInput(const HardwareInput *input);
+	void removeHardwareInput(const HardwareInput *input);
+
+private:
 
 	List<const HardwareInput *> _inputs;
 };
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp
index 719902e..bda4cd4 100644
--- a/backends/keymapper/keymapper.cpp
+++ b/backends/keymapper/keymapper.cpp
@@ -69,8 +69,8 @@ void Keymapper::registerHardwareInputSet(HardwareInputSet *inputs) {
 		error("Hardware input set already registered");
 
 	if (!inputs) {
-		warning("No hardware input are supplied");
-		return;
+		warning("No hardware input were defined, using defaults");
+		inputs = new HardwareInputSet(true);
 	}
 
 	_hardwareInputs = inputs;
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp
index 5e8b6e1..d1cdbc9 100644
--- a/backends/platform/maemo/maemo.cpp
+++ b/backends/platform/maemo/maemo.cpp
@@ -183,7 +183,7 @@ void OSystem_SDL_Maemo::setupIcon() {
 
 #ifdef ENABLE_KEYMAPPER
 Common::HardwareInputSet *OSystem_SDL_Maemo::getHardwareInputSet() {
-	return new Common::HardwareInputSet(Common::maemoKeys, Common::maemoModifiers);
+	return new Common::HardwareInputSet(false, Common::maemoKeys, Common::maemoModifiers);
 }
 
 Common::Keymap *OSystem_SDL_Maemo::getGlobalKeymap() {
diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp
deleted file mode 100644
index 0b73bfa..0000000
--- a/backends/platform/sdl/hardwarekeys.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/* 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.
- *
- */
-
-#include "backends/platform/sdl/sdl.h"
-#include "backends/keymapper/keymapper.h"
-#include "common/keyboard.h"
-
-#ifdef ENABLE_KEYMAPPER
-
-using namespace Common;
-
-static const KeyTableEntry sdlKeys[] = {
-	{"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", false},
-	{"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", false},
-	{"CLEAR", KEYCODE_CLEAR, 0, "Clear", false},
-	{"RETURN", KEYCODE_RETURN, ASCII_RETURN, "Return", false},
-	{"PAUSE", KEYCODE_PAUSE, 0, "Pause", false},
-	{"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", false},
-	{"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", false},
-	{"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", false},
-	{"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", false},
-	{"HASH", KEYCODE_HASH, '#', "#", false},
-	{"DOLLAR", KEYCODE_DOLLAR, '$', "$", false},
-	{"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", false},
-	{"QUOTE", KEYCODE_QUOTE, '\'', "'", false},
-	{"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", false},
-	{"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", false},
-	{"ASTERISK", KEYCODE_ASTERISK, '*', "*", false},
-	{"PLUS", KEYCODE_PLUS, '+', "+", false},
-	{"COMMA", KEYCODE_COMMA, ',', ",", false},
-	{"MINUS", KEYCODE_MINUS, '-', "-", false},
-	{"PERIOD", KEYCODE_PERIOD, '.', ".", false},
-	{"SLASH", KEYCODE_SLASH, '/', "/", false},
-	{"0", KEYCODE_0, '0', "0", false},
-	{"1", KEYCODE_1, '1', "1", false},
-	{"2", KEYCODE_2, '2', "2", false},
-	{"3", KEYCODE_3, '3', "3", false},
-	{"4", KEYCODE_4, '4', "4", false},
-	{"5", KEYCODE_5, '5', "5", false},
-	{"6", KEYCODE_6, '6', "6", false},
-	{"7", KEYCODE_7, '7', "7", false},
-	{"8", KEYCODE_8, '8', "8", false},
-	{"9", KEYCODE_9, '9', "9", false},
-	{"COLON", KEYCODE_COLON, ':', ":", false},
-	{"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", false},
-	{"LESS", KEYCODE_LESS, '<', "<", false},
-	{"EQUALS", KEYCODE_EQUALS, '=', "=", false},
-	{"GREATER", KEYCODE_GREATER, '>', ">", false},
-	{"QUESTION", KEYCODE_QUESTION, '?', "?", false},
-	{"AT", KEYCODE_AT, '@', "@", false},
-
-	{"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", false},
-	{"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", false},
-	{"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", false},
-	{"CARET", KEYCODE_CARET, '^', "^", false},
-	{"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", false},
-	{"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", false},
-	{"a", KEYCODE_a, 'a', "a", true},
-	{"b", KEYCODE_b, 'b', "b", true},
-	{"c", KEYCODE_c, 'c', "c", true},
-	{"d", KEYCODE_d, 'd', "d", true},
-	{"e", KEYCODE_e, 'e', "e", true},
-	{"f", KEYCODE_f, 'f', "f", true},
-	{"g", KEYCODE_g, 'g', "g", true},
-	{"h", KEYCODE_h, 'h', "h", true},
-	{"i", KEYCODE_i, 'i', "i", true},
-	{"j", KEYCODE_j, 'j', "j", true},
-	{"k", KEYCODE_k, 'k', "k", true},
-	{"l", KEYCODE_l, 'l', "l", true},
-	{"m", KEYCODE_m, 'm', "m", true},
-	{"n", KEYCODE_n, 'n', "n", true},
-	{"o", KEYCODE_o, 'o', "o", true},
-	{"p", KEYCODE_p, 'p', "p", true},
-	{"q", KEYCODE_q, 'q', "q", true},
-	{"r", KEYCODE_r, 'r', "r", true},
-	{"s", KEYCODE_s, 's', "s", true},
-	{"t", KEYCODE_t, 't', "t", true},
-	{"u", KEYCODE_u, 'u', "u", true},
-	{"v", KEYCODE_v, 'v', "v", true},
-	{"w", KEYCODE_w, 'w', "w", true},
-	{"x", KEYCODE_x, 'x', "x", true},
-	{"y", KEYCODE_y, 'y', "y", true},
-	{"z", KEYCODE_z, 'z', "z", true},
-	{"DELETE", KEYCODE_DELETE, 0, "Del", false},
-
-	// Numeric keypad
-	{"KP0", KEYCODE_KP0, 0, "KP0", false},
-	{"KP1", KEYCODE_KP1, 0, "KP1", false},
-	{"KP2", KEYCODE_KP2, 0, "KP2", false},
-	{"KP3", KEYCODE_KP3, 0, "KP3", false},
-	{"KP4", KEYCODE_KP4, 0, "KP4", false},
-	{"KP5", KEYCODE_KP5, 0, "KP5", false},
-	{"KP6", KEYCODE_KP6, 0, "KP6", false},
-	{"KP7", KEYCODE_KP7, 0, "KP7", false},
-	{"KP8", KEYCODE_KP8, 0, "KP8", false},
-	{"KP9", KEYCODE_KP9, 0, "KP9", false},
-	{"KP_PERIOD", KEYCODE_KP_PERIOD, 0, "KP.", false},
-	{"KP_DIVIDE", KEYCODE_KP_DIVIDE, 0, "KP/", false},
-	{"KP_MULTIPLY", KEYCODE_KP_MULTIPLY, 0, "KP*", false},
-	{"KP_MINUS", KEYCODE_KP_MINUS, 0, "KP-", false},
-	{"KP_PLUS", KEYCODE_KP_PLUS, 0, "KP+", false},
-	{"KP_ENTER", KEYCODE_KP_ENTER, 0, "KP Enter", false},
-	{"KP_EQUALS", KEYCODE_KP_EQUALS, 0, "KP=", false},
-
-	// Arrows + Home/End pad
-	{"UP", KEYCODE_UP, 0, "Up", false},
-	{"DOWN", KEYCODE_DOWN, 0, "Down", false},
-	{"RIGHT", KEYCODE_RIGHT, 0, "Right", false},
-	{"LEFT", KEYCODE_LEFT, 0, "Left", false},
-	{"INSERT", KEYCODE_INSERT, 0, "Insert", false},
-	{"HOME", KEYCODE_HOME, 0, "Home", false},
-	{"END", KEYCODE_END, 0, "End", false},
-	{"PAGEUP", KEYCODE_PAGEUP, 0, "PgUp", false},
-	{"PAGEDOWN", KEYCODE_PAGEDOWN, 0, "PgDn", false},
-
-	// Function keys
-	{"F1", KEYCODE_F1, ASCII_F1, "F1", false},
-	{"F2", KEYCODE_F2, ASCII_F2, "F2", false},
-	{"F3", KEYCODE_F3, ASCII_F3, "F3", false},
-	{"F4", KEYCODE_F4, ASCII_F4, "F4", false},
-	{"F5", KEYCODE_F5, ASCII_F5, "F5", false},
-	{"F6", KEYCODE_F6, ASCII_F6, "F6", false},
-	{"F7", KEYCODE_F7, ASCII_F7, "F7", false},
-	{"F8", KEYCODE_F8, ASCII_F8, "F8", false},
-	{"F9", KEYCODE_F9, ASCII_F9, "F9", false},
-	{"F10", KEYCODE_F10, ASCII_F10, "F10", false},
-	{"F11", KEYCODE_F11, ASCII_F11, "F11", false},
-	{"F12", KEYCODE_F12, ASCII_F12, "F12", false},
-	{"F13", KEYCODE_F13, 0, "F13", false},
-	{"F14", KEYCODE_F14, 0, "F14", false},
-	{"F15", KEYCODE_F15, 0, "F15", false},
-
-	// Miscellaneous function keys
-	{"HELP", KEYCODE_HELP, 0, "Help", false},
-	{"PRINT", KEYCODE_PRINT, 0, "Print", false},
-	{"SYSREQ", KEYCODE_SYSREQ, 0, "SysRq", false},
-	{"BREAK", KEYCODE_BREAK, 0, "Break", false},
-	{"MENU", KEYCODE_MENU, 0, "Menu", false},
-		// Power Macintosh power key
-	{"POWER", KEYCODE_POWER, 0, "Power", false},
-		// Some european keyboards
-	{"EURO", KEYCODE_EURO, 0, "Euro", false},
-		// Atari keyboard has Undo
-	{"UNDO", KEYCODE_UNDO, 0, "Undo", false},
-	{0, KEYCODE_INVALID, 0, 0, false}
-};
-
-static const ModifierTableEntry sdlModifiers[] = {
-	{ 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 }
-};
-
-Common::HardwareInputSet *OSystem_SDL::getHardwareInputSet() {
-	return new HardwareInputSet(sdlKeys, sdlModifiers);
-}
-#endif
diff --git a/backends/platform/sdl/module.mk b/backends/platform/sdl/module.mk
index f1afe37..98a8265 100644
--- a/backends/platform/sdl/module.mk
+++ b/backends/platform/sdl/module.mk
@@ -1,7 +1,6 @@
 MODULE := backends/platform/sdl
 
 MODULE_OBJS := \
-	hardwarekeys.o \
 	main.o \
 	sdl.o
 
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 51a7b2f..f05207b 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -58,9 +58,6 @@ public:
 	virtual void engineInit();
 	virtual void engineDone();
 #endif
-#ifdef ENABLE_KEYMAPPER
-	virtual Common::HardwareInputSet *getHardwareInputSet();
-#endif
 	virtual void quit();
 	virtual void fatalError();
 


Commit: 657206bc5b840006ea9f98767ade937f9fc0fab0
    https://github.com/scummvm/scummvm/commit/657206bc5b840006ea9f98767ade937f9fc0fab0
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2012-02-28T04:46:19-08:00

Commit Message:
MAEMO: Define only special keys to Keymapper

Also get rid of static tables in headers.

Changed paths:
  R backends/platform/maemo/maemo-keys.h
    backends/platform/maemo/maemo.cpp



diff --git a/backends/platform/maemo/maemo-keys.h b/backends/platform/maemo/maemo-keys.h
deleted file mode 100644
index ae3a746..0000000
--- a/backends/platform/maemo/maemo-keys.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* 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.
- *
- */
-
-#if defined(MAEMO)
-#if defined(ENABLE_KEYMAPPER)
-
-#ifndef PLATFORM_SDL_MAEMO_KEYS_H
-#define PLATFORM_SDL_MAEMO_KEYS_H
-
-#include "common/keyboard.h"
-
-#include "backends/keymapper/hardware-input.h"
-
-namespace Common {
-
-static const ModifierTableEntry maemoModifiers[] = {
-	{ 0, "", "", false },
-	{ KBD_CTRL, "C+", "Ctrl+", false },
-	{ KBD_SHIFT, "", "", true },
-	{ KBD_SHIFT | KBD_CTRL, "S+C+", "Shift+Ctrl+", true },
-	{ 0, 0, 0, false }
-};
-
-static const KeyTableEntry maemoKeys[] = {
-	{"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", false},
-	{"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", false},
-	{"CLEAR", KEYCODE_CLEAR, 0, "Clear", false},
-	{"RETURN", KEYCODE_RETURN, ASCII_RETURN, "MCenter", false},
-	{"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", false},
-	{"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", false},
-	{"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", false},
-	{"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", false},
-	{"HASH", KEYCODE_HASH, '#', "#", false},
-	{"DOLLAR", KEYCODE_DOLLAR, '$', "$", false},
-	{"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", false},
-	{"QUOTE", KEYCODE_QUOTE, '\'', "'", false},
-	{"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", false},
-	{"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", false},
-	{"ASTERISK", KEYCODE_ASTERISK, '*', "*", false},
-	{"PLUS", KEYCODE_PLUS, '+', "+", false},
-	{"COMMA", KEYCODE_COMMA, ',', ",", false},
-	{"MINUS", KEYCODE_MINUS, '-', "-", false},
-	{"PERIOD", KEYCODE_PERIOD, '.', ".", false},
-	{"SLASH", KEYCODE_SLASH, '/', "/", false},
-	{"0", KEYCODE_0, '0', "0", false},
-	{"1", KEYCODE_1, '1', "1", false},
-	{"2", KEYCODE_2, '2', "2", false},
-	{"3", KEYCODE_3, '3', "3", false},
-	{"4", KEYCODE_4, '4', "4", false},
-	{"5", KEYCODE_5, '5', "5", false},
-	{"6", KEYCODE_6, '6', "6", false},
-	{"7", KEYCODE_7, '7', "7", false},
-	{"8", KEYCODE_8, '8', "8", false},
-	{"9", KEYCODE_9, '9', "9", false},
-	{"COLON", KEYCODE_COLON, ':', ":", false},
-	{"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", false},
-	{"LESS", KEYCODE_LESS, '<', "<", false},
-	{"EQUALS", KEYCODE_EQUALS, '=', "=", false},
-	{"GREATER", KEYCODE_GREATER, '>', ">", false},
-	{"QUESTION", KEYCODE_QUESTION, '?', "?", false},
-	{"AT", KEYCODE_AT, '@', "@", false},
-
-	{"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", false},
-	{"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", false},
-	{"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", false},
-	{"CARET", KEYCODE_CARET, '^', "^", false},
-	{"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", false},
-	{"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", false},
-	{"a", KEYCODE_a, 'a', "a", true},
-	{"b", KEYCODE_b, 'b', "b", true},
-	{"c", KEYCODE_c, 'c', "c", true},
-	{"d", KEYCODE_d, 'd', "d", true},
-	{"e", KEYCODE_e, 'e', "e", true},
-	{"f", KEYCODE_f, 'f', "f", true},
-	{"g", KEYCODE_g, 'g', "g", true},
-	{"h", KEYCODE_h, 'h', "h", true},
-	{"i", KEYCODE_i, 'i', "i", true},
-	{"j", KEYCODE_j, 'j', "j", true},
-	{"k", KEYCODE_k, 'k', "k", true},
-	{"l", KEYCODE_l, 'l', "l", true},
-	{"m", KEYCODE_m, 'm', "m", true},
-	{"n", KEYCODE_n, 'n', "n", true},
-	{"o", KEYCODE_o, 'o', "o", true},
-	{"p", KEYCODE_p, 'p', "p", true},
-	{"q", KEYCODE_q, 'q', "q", true},
-	{"r", KEYCODE_r, 'r', "r", true},
-	{"s", KEYCODE_s, 's', "s", true},
-	{"t", KEYCODE_t, 't', "t", true},
-	{"u", KEYCODE_u, 'u', "u", true},
-	{"v", KEYCODE_v, 'v', "v", true},
-	{"w", KEYCODE_w, 'w', "w", true},
-	{"x", KEYCODE_x, 'x', "x", true},
-	{"y", KEYCODE_y, 'y', "y", true},
-	{"z", KEYCODE_z, 'z', "z", true},
-	{"DELETE", KEYCODE_DELETE, 0, "Del", false},
-
-	{"KP_ENTER", KEYCODE_KP_ENTER, 0, "Enter", false},
-
-	// Arrows + Home/End pad
-	{"UP", KEYCODE_UP, 0, "Up", false},
-	{"DOWN", KEYCODE_DOWN, 0, "Down", false},
-	{"RIGHT", KEYCODE_RIGHT, 0, "Right", false},
-	{"LEFT", KEYCODE_LEFT, 0, "Left", false},
-
-	// Function keys
-	{"MENU", KEYCODE_F11, 0, "Menu", false},
-	{"HOME", KEYCODE_F12, 0, "Home", false},
-	{"FULLSCREEN", KEYCODE_F13, 0, "FullScreen", false},
-	{"ZOOMPLUS", KEYCODE_F14, 0, "Zoom+", false},
-	{"ZOOMMINUS", KEYCODE_F15, 0, "Zoom-", false},
-
-	{0, KEYCODE_INVALID, 0, 0, false}
-};
-
-} // namespace Common
-
-#endif // ifndef PLATFORM_SDL_MAEMO_KEYS_H
-
-#endif // if defined(ENABLE_KEYMAPPER)
-#endif // if defined(MAEMO)
diff --git a/backends/platform/maemo/maemo.cpp b/backends/platform/maemo/maemo.cpp
index d1cdbc9..e296d47 100644
--- a/backends/platform/maemo/maemo.cpp
+++ b/backends/platform/maemo/maemo.cpp
@@ -28,7 +28,6 @@
 #include "common/config-manager.h"
 
 #include "backends/platform/maemo/maemo.h"
-#include "backends/platform/maemo/maemo-keys.h"
 #include "backends/events/maemosdl/maemosdl-events.h"
 #include "backends/graphics/maemosdl/maemosdl-graphics.h"
 #include "backends/keymapper/keymapper.h"
@@ -181,9 +180,20 @@ void OSystem_SDL_Maemo::setupIcon() {
 	// http://bugzilla.libsdl.org/show_bug.cgi?id=586
 }
 
+static const Common::KeyTableEntry maemoKeys[] = {
+	// Function keys
+	{"MENU", Common::KEYCODE_F11, 0, "Menu", false},
+	{"HOME", Common::KEYCODE_F12, 0, "Home", false},
+	{"FULLSCREEN", Common::KEYCODE_F13, 0, "FullScreen", false},
+	{"ZOOMPLUS", Common::KEYCODE_F14, 0, "Zoom+", false},
+	{"ZOOMMINUS", Common::KEYCODE_F15, 0, "Zoom-", false},
+
+	{0, Common::KEYCODE_INVALID, 0, 0, false}
+};
+
 #ifdef ENABLE_KEYMAPPER
 Common::HardwareInputSet *OSystem_SDL_Maemo::getHardwareInputSet() {
-	return new Common::HardwareInputSet(false, Common::maemoKeys, Common::maemoModifiers);
+	return new Common::HardwareInputSet(true, maemoKeys);
 }
 
 Common::Keymap *OSystem_SDL_Maemo::getGlobalKeymap() {






More information about the Scummvm-git-logs mailing list