ScummVM API documentation
keyboard.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef AGI_KEYBOARD_H
23 #define AGI_KEYBOARD_H
24 
25 namespace Agi {
26 
27 #define keyEnqueue(k) \
28  do { \
29  _keyQueue[_keyQueueEnd++] = (k); \
30  _keyQueueEnd %= KEY_QUEUE_SIZE; \
31  } while (0)
32 #define keyDequeue(k) \
33  do { \
34  (k) = _keyQueue[_keyQueueStart++]; \
35  _keyQueueStart %= KEY_QUEUE_SIZE; \
36  } while (0)
37 
38 // Class to turn on synthetic events temporarily. Usually until the end of the
39 // current function.
40 
42 private:
43  AgiEngine *_vm;
44 public:
45  AllowSyntheticEvents(AgiEngine *vm) : _vm(vm) {
46  _vm->allowSynthetic(true);
47  }
48 
50  _vm->allowSynthetic(false);
51  }
52 };
53 
54 #define AGI_KEY_BACKSPACE 0x08
55 #define AGI_KEY_ESCAPE 0x1B
56 #define AGI_KEY_ENTER 0x0D
57 #define AGI_KEY_UP 0x4800
58 #define AGI_KEY_DOWN 0x5000
59 #define AGI_KEY_LEFT 0x4B00
60 #define AGI_KEY_STATIONARY 0x4C00
61 #define AGI_KEY_RIGHT 0x4D00
62 
63 #define AGI_KEY_DOWN_LEFT 0x4F00
64 #define AGI_KEY_DOWN_RIGHT 0x5100
65 #define AGI_KEY_UP_LEFT 0x4700
66 #define AGI_KEY_UP_RIGHT 0x4900
67 
68 #define AGI_KEY_F1 0x3B00
69 #define AGI_KEY_F2 0x3C00
70 #define AGI_KEY_F3 0x3D00
71 #define AGI_KEY_F4 0x3E00
72 #define AGI_KEY_F5 0x3F00
73 #define AGI_KEY_F6 0x4000
74 #define AGI_KEY_F7 0x4100
75 #define AGI_KEY_F8 0x4200
76 #define AGI_KEY_F9 0x4300
77 #define AGI_KEY_F10 0x4400
78 #define AGI_KEY_F11 0xd900 // F11
79 #define AGI_KEY_F12 0xda00 // F12
80 
81 #define AGI_KEY_PAGE_UP 0x4900 // Page Up (fixed by Ziv Barber)
82 #define AGI_KEY_PAGE_DOWN 0x5100 // Page Down
83 #define AGI_KEY_HOME 0x4700 // Home
84 #define AGI_KEY_END 0x4f00 // End *
85 
86 #define AGI_MOUSE_BUTTON_LEFT 0xF101 // Left mouse button
87 #define AGI_MOUSE_BUTTON_RIGHT 0xF202 // Right mouse button
88 #define AGI_MOUSE_WHEEL_UP 0xF203 // Mouse wheel up
89 #define AGI_MOUSE_WHEEL_DOWN 0xF204 // Mouse wheel down
90 
91 // special menu triggers
92 // Attention: at least Mixed Up Mother Goose on Apple IIgs actually hooks ESC for menu only
93 // Which is why we have to check, if the corresponding trigger is hooked before changing it
94 // And otherwise simply use the regular ESC.
95 #define AGI_MENU_TRIGGER_PC 0x001B // will trigger menu for PC
96 #define AGI_MENU_TRIGGER_APPLE2GS 0x0301 // will trigger menu for AppleIIgs + Amiga
97 #define AGI_MENU_TRIGGER_ATARIST 0x0101 // will trigger menu for Atari ST
98 
99 extern const uint8 scancodeTable[];
100 
101 } // End of namespace Agi
102 
103 #endif /* AGI_KEYBOARD_H */
Definition: agi.h:839
Definition: keyboard.h:41
Definition: agi.h:63