1 /* Copyright (c) 2005 Russ Cox, see README for licence details */
9 #include <X11/extensions/shape.h>
12 #include "patchlevel.h"
20 static int tabcode = 0x17;
21 /*static int altcode = 0x40; */
22 /*static int pgupcode = 0x63; */
23 /*static int pgdowncode = 0x69; */
25 static void alttab(int shift);
32 for(i=0; i<num_screens; i++){
33 XGrabKey(dpy, tabcode, Mod1Mask, screens[i].root, 0, GrabModeSync, GrabModeAsync);
34 XGrabKey(dpy, tabcode, Mod1Mask|ShiftMask, screens[i].root, 0, GrabModeSync, GrabModeAsync);
35 /* XGrabKey(dpy, pgupcode, Mod1Mask, screens[i].root, 0, GrabModeSync, GrabModeAsync); */
36 /* XGrabKey(dpy, pgdowncode, Mod1Mask, screens[i].root, 0, GrabModeSync, GrabModeAsync); */
37 /* XGrabKey(dpy, altcode, 0, screens[i].root, 0, GrabModeSync, GrabModeAsync); */
42 keypress(XKeyEvent *e)
45 * process key press here
48 if(e->keycode == tabcode)
49 alttab(e->state&ShiftMask);
50 XAllowEvents(dpy, SyncKeyboard, e->time);
54 keyrelease(XKeyEvent *e)
56 XAllowEvents(dpy, SyncKeyboard, e->time);
63 /* fprintf(stderr, "%sTab\n", shift ? "Back" : ""); */