aboutsummaryrefslogtreecommitdiff
path: root/common/keyboard.h
diff options
context:
space:
mode:
authorMax Horn2007-06-23 10:06:39 +0000
committerMax Horn2007-06-23 10:06:39 +0000
commit2bbe67afdf4d4df36fc100690cf87c8a75d5a354 (patch)
tree8c1f52f95f3799a25638a9b598865d8f8a5ccb5d /common/keyboard.h
parent40e7a533ee30bc578a02b7ea76c4144a9ffeb549 (diff)
downloadscummvm-rg350-2bbe67afdf4d4df36fc100690cf87c8a75d5a354.tar.gz
scummvm-rg350-2bbe67afdf4d4df36fc100690cf87c8a75d5a354.tar.bz2
scummvm-rg350-2bbe67afdf4d4df36fc100690cf87c8a75d5a354.zip
Added more flexible KeyState constructor; updated comment in gui/Key.h
svn-id: r27654
Diffstat (limited to 'common/keyboard.h')
-rw-r--r--common/keyboard.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/common/keyboard.h b/common/keyboard.h
index f526b8cb8e..d0d0e43f00 100644
--- a/common/keyboard.h
+++ b/common/keyboard.h
@@ -233,6 +233,7 @@ struct KeyState {
* and look at that, if you want to find out a key code.
*/
KeyCode keycode;
+
/**
* ASCII-value of the pressed key (if any).
* This depends on modifiers, i.e. pressing the 'A' key results in
@@ -240,6 +241,7 @@ struct KeyState {
* caps lock.
*/
uint16 ascii;
+
/**
* Status of the modifier keys. Bits are set in this for each
* pressed modifier
@@ -247,7 +249,12 @@ struct KeyState {
*/
byte flags;
- KeyState() { reset(); }
+ KeyState(KeyCode kc = KEYCODE_INVALID, uint16 asc = 0, byte f = 0) {
+ keycode = kc;
+ ascii = asc ? asc : (uint16)kc;
+ flags = f;
+ }
+
void reset() {
keycode = KEYCODE_INVALID;
ascii = flags = 0;