aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/keyboard.h
diff options
context:
space:
mode:
authorTorbjörn Andersson2007-03-17 16:08:29 +0000
committerTorbjörn Andersson2007-03-17 16:08:29 +0000
commit8a2529b2d6fa83efc0da64e4f7fc003d84b18a59 (patch)
tree91a8d7ac21da95d4f2750b0ea504f155afe7786c /engines/agi/keyboard.h
parentcfe7ecd6d914026080698e5c6330a0ee1db6b8a9 (diff)
downloadscummvm-rg350-8a2529b2d6fa83efc0da64e4f7fc003d84b18a59.tar.gz
scummvm-rg350-8a2529b2d6fa83efc0da64e4f7fc003d84b18a59.tar.bz2
scummvm-rg350-8a2529b2d6fa83efc0da64e4f7fc003d84b18a59.zip
Allow synthetic events in dialog windows, e.g. so you can use keyboard repeat
when scrolling the list of savegames. svn-id: r26175
Diffstat (limited to 'engines/agi/keyboard.h')
-rw-r--r--engines/agi/keyboard.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/engines/agi/keyboard.h b/engines/agi/keyboard.h
index 0220db41c5..67e4679b65 100644
--- a/engines/agi/keyboard.h
+++ b/engines/agi/keyboard.h
@@ -34,6 +34,22 @@ namespace Agi {
#define keyDequeue(k) do { (k) = _keyQueue[_keyQueueStart++]; \
_keyQueueStart %= KEY_QUEUE_SIZE; } while (0)
+// Class to turn on synthetic events temporarily. Usually until the end of the
+// current function.
+
+class AllowSyntheticEvents {
+private:
+ AgiEngine *_vm;
+public:
+ AllowSyntheticEvents(AgiEngine *vm) : _vm(vm) {
+ _vm->allowSynthetic(true);
+ }
+
+ ~AllowSyntheticEvents() {
+ _vm->allowSynthetic(false);
+ }
+};
+
/* QNX4 has a KEY_DOWN defined which we don't need to care about */
#undef KEY_DOWN