KEYMAPPER: Allow simple events to be added to an Action

This also simplifies the Action code a little bit
This commit is contained in:
Tarek Soliman 2012-02-02 18:52:12 -06:00
parent 718e106a31
commit 70d94bdd2c

View File

@ -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() {