[Scummvm-cvs-logs] scummvm master -> a488556dcdfb69ec30af740aa2c71977f505ef35
tsoliman
tarek at bashasoliman.com
Fri Feb 3 02:14:50 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:
718e106a31 COMMON: Fix comment typo
70d94bdd2c KEYMAPPER: Allow simple events to be added to an Action
a488556dcd KEYMAPPER: Handle EVENT_MAINMENU directly
Commit: 718e106a310cf1cc4aaf99ff61ef74f7c415aa27
https://github.com/scummvm/scummvm/commit/718e106a310cf1cc4aaf99ff61ef74f7c415aa27
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2012-02-02T16:10:08-08:00
Commit Message:
COMMON: Fix comment typo
Changed paths:
common/events.h
diff --git a/common/events.h b/common/events.h
index f5ace74..673ccb6 100644
--- a/common/events.h
+++ b/common/events.h
@@ -175,7 +175,7 @@ public:
*
* An observer is supposed to eat the event, with returning true, when
* it wants to prevent other observers from receiving the event.
- * An usage example here is the keymapper:
+ * A usage example here is the keymapper:
* If it processes an Event, it should 'eat' it and create a new
* event, which the EventDispatcher will then catch.
*
Commit: 70d94bdd2c469bd8cd52b8d2367c64130b1679f1
https://github.com/scummvm/scummvm/commit/70d94bdd2c469bd8cd52b8d2367c64130b1679f1
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2012-02-02T17:05:05-08:00
Commit Message:
KEYMAPPER: Allow simple events to be added to an Action
This also simplifies the Action code a little bit
Changed paths:
backends/keymapper/action.h
diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h
index e5bf6d5..308a76a 100644
--- a/backends/keymapper/action.h
+++ b/backends/keymapper/action.h
@@ -75,6 +75,13 @@ public:
events.push_back(evt);
}
+ void addEvent(const EventType evtType) {
+ Event evt;
+
+ evt.type = evtType;
+ events.push_back(evt);
+ }
+
void addKeyEvent(const KeyState &ks) {
Event evt;
@@ -84,24 +91,15 @@ public:
}
void addLeftClickEvent() {
- Event evt;
-
- evt.type = EVENT_LBUTTONDOWN;
- addEvent(evt);
+ addEvent(EVENT_LBUTTONDOWN);
}
void addMiddleClickEvent() {
- Event evt;
-
- evt.type = EVENT_MBUTTONDOWN;
- addEvent(evt);
+ addEvent(EVENT_MBUTTONDOWN);
}
void addRightClickEvent() {
- Event evt;
-
- evt.type = EVENT_RBUTTONDOWN;
- addEvent(evt);
+ addEvent(EVENT_RBUTTONDOWN);
}
Keymap *getParent() {
Commit: a488556dcdfb69ec30af740aa2c71977f505ef35
https://github.com/scummvm/scummvm/commit/a488556dcdfb69ec30af740aa2c71977f505ef35
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2012-02-02T17:10:01-08:00
Commit Message:
KEYMAPPER: Handle EVENT_MAINMENU directly
Changed paths:
backends/keymapper/keymapper.cpp
base/main.cpp
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp
index 3871134..6d9ae21 100644
--- a/backends/keymapper/keymapper.cpp
+++ b/backends/keymapper/keymapper.cpp
@@ -268,6 +268,9 @@ void Keymapper::executeAction(const Action *action, bool keyDown) {
case EVENT_MBUTTONUP:
if (keyDown) evt.type = EVENT_MBUTTONDOWN;
break;
+ case EVENT_MAINMENU:
+ if (!keyDown) evt.type = EVENT_MAINMENU;
+ break;
default:
// don't deliver other events on key up
if (!keyDown) continue;
diff --git a/base/main.cpp b/base/main.cpp
index b39165e..c6f29bc 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -275,7 +275,7 @@ static void setupKeymapper(OSystem &system) {
// Now create the global keymap
act = new Action(globalMap, "MENU", _("Menu"), kGenericActionType, kSelectKeyType);
- act->addKeyEvent(KeyState(KEYCODE_F5, ASCII_F5, 0));
+ act->addEvent(EVENT_MAINMENU);
act = new Action(globalMap, "SKCT", _("Skip"), kGenericActionType, kActionKeyType);
act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0));
More information about the Scummvm-git-logs
mailing list