summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2020-03-07 05:43:48 -0600
committerepoch <epoch@hacking.allowed.org>2020-03-07 05:43:48 -0600
commit1de9b6df32d18eaf44b668f79217ff4a0d7973e2 (patch)
tree88b335340467076baac916b355c380029e827233
parent3d0b054e07fc090b32cb5fea452ef659ee176a71 (diff)
downloadhackvr-1de9b6df32d18eaf44b668f79217ff4a0d7973e2.tar.gz
hackvr-1de9b6df32d18eaf44b668f79217ff4a0d7973e2.zip
added a couple more key bindings for X11
-rw-r--r--src/keyboard_x11.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/keyboard_x11.c b/src/keyboard_x11.c
index 67def88..551e290 100644
--- a/src/keyboard_x11.c
+++ b/src/keyboard_x11.c
@@ -79,14 +79,26 @@ hvk_t x11_passthru(XKeyEvent *xkey) {
hvk_t x11_keypress_handler(XKeyEvent *xkey) {//this only needs to return HVK_ keys based on the XKeyEvent's value... this could be a sparse array.
int sym=XLookupKeysym(xkey,0);
switch(sym) {
- case XK_r: return HVK_UP;
- case XK_w: return HVK_FORWARD;
- case XK_space: return HVK_JUMP;
- case XK_s: return HVK_BACKWARD;
- case XK_a: return HVK_LEFT;
- case XK_d: return HVK_RIGHT;
- case XK_Escape: return HVK_ESCAPE;
- case XK_f: return HVK_MAGIC;
+ case XK_r:
+ return HVK_UP;
+ case XK_w: case XK_Up:
+ return HVK_FORWARD;
+ case XK_space:
+ return HVK_JUMP;
+ case XK_s: case XK_Down:
+ return HVK_BACKWARD;
+ case XK_Left:
+ return HVK_TURNLEFT;
+ case XK_Right:
+ return HVK_TURNRIGHT;
+ case XK_a:
+ return HVK_LEFT;
+ case XK_d:
+ return HVK_RIGHT;
+ case XK_Escape:
+ return HVK_ESCAPE;
+ case XK_f:
+ return HVK_DOWN;
default: return 0;//HVK_NONE;//0
}
return 0;