diff options
author | Mathieu Lonjaret <mathieu.lonjaret@gmail.com> | 2010-02-18 22:34:37 -0800 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2010-02-18 22:34:37 -0800 |
commit | c4da64274d01d25fe699f888ce7ad6311bf4ef8b (patch) | |
tree | 03d22865627d579dec68c70dfd4d97443a665f4e /src/cmd/rio/key.c | |
parent | 93ee60c3691d2b4699e970d63363500cade26264 (diff) | |
download | plan9port-c4da64274d01d25fe699f888ce7ad6311bf4ef8b.tar.gz plan9port-c4da64274d01d25fe699f888ce7ad6311bf4ef8b.tar.bz2 plan9port-c4da64274d01d25fe699f888ce7ad6311bf4ef8b.zip |
rio: add alt-tab for cycling windows
R=rsc
CC=codebot
http://codereview.appspot.com/207093
Diffstat (limited to 'src/cmd/rio/key.c')
-rw-r--r-- | src/cmd/rio/key.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cmd/rio/key.c b/src/cmd/rio/key.c index 95333ec5..12cc53ea 100644 --- a/src/cmd/rio/key.c +++ b/src/cmd/rio/key.c @@ -17,7 +17,7 @@ enum GrabAltAny }; -static int tabcode = 0x17; +/*static int tabcode = 0x17; */ /*static int altcode = 0x40; */ /*static int pgupcode = 0x63; */ /*static int pgdowncode = 0x69; */ @@ -28,6 +28,7 @@ void keysetup(void) { int i; + int tabcode = XKeysymToKeycode(dpy, XK_Tab); for(i=0; i<num_screens; i++){ XGrabKey(dpy, tabcode, Mod1Mask, screens[i].root, 0, GrabModeSync, GrabModeAsync); @@ -44,8 +45,8 @@ keypress(XKeyEvent *e) /* * process key press here */ - if(0) - if(e->keycode == tabcode) + int tabcode = XKeysymToKeycode(dpy, XK_Tab); + if(e->keycode == tabcode && (e->state&Mod1Mask) == (1<<3)) alttab(e->state&ShiftMask); XAllowEvents(dpy, SyncKeyboard, e->time); } |