projects
/
universe.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refreshed the code to compile without warning.
[universe.git]
/
simple_window.cc
diff --git
a/simple_window.cc
b/simple_window.cc
index
f0905df
..
7fee9c2
100644
(file)
--- a/
simple_window.cc
+++ b/
simple_window.cc
@@
-186,17
+186,24
@@
SimpleEvent SimpleWindow::event() {
break;
case KeyPress:
break;
case KeyPress:
+ KeySym mykey;
+ mykey = XkbKeycodeToKeysym(_display,
+ event.xkey.keycode, 0,
+ event.xkey.state & ShiftMask ? 1 : 0);
+
se.type = SimpleEvent::KEY_PRESS;
se.type = SimpleEvent::KEY_PRESS;
- strncpy(se.key,
- XKeysymToString(XKeycodeToKeysym(_display, event.xkey.keycode, 0)),
- (sizeof(se.key)/sizeof(char) - 1));
+ strncpy(se.key, XKeysymToString(mykey), (sizeof(se.key)/sizeof(char) - 1));
+
break;
case KeyRelease:
break;
case KeyRelease:
+ KeySym mykey;
+ mykey = XkbKeycodeToKeysym(_display,
+ event.xkey.keycode, 0,
+ event.xkey.state & ShiftMask ? 1 : 0);
+
se.type = SimpleEvent::KEY_RELEASE;
se.type = SimpleEvent::KEY_RELEASE;
- strncpy(se.key,
- XKeysymToString(XKeycodeToKeysym(_display, event.xkey.keycode, 0)),
- (sizeof(se.key)/sizeof(char) - 1));
+ strncpy(se.key, XKeysymToString(mykey), (sizeof(se.key)/sizeof(char) - 1));
break;
default:
break;
default: