mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Add xu_key_ungrab() and a mirror to xu_key_ungrab(). a couple of changes
that are coming up depend on it. ok okan.
This commit is contained in:
parent
13b640ea29
commit
20052e0248
1
calmwm.h
1
calmwm.h
@ -391,6 +391,7 @@ void xu_ptr_ungrab(void);
|
||||
void xu_ptr_setpos(Window, int, int);
|
||||
void xu_ptr_getpos(Window, int *, int *);
|
||||
void xu_key_grab(Window, int, int);
|
||||
void xu_key_ungrab(Window, int, int);
|
||||
void xu_sendmsg(struct client_ctx *, Atom, long);
|
||||
int xu_getprop(struct client_ctx *, Atom, Atom, long,
|
||||
u_char **);
|
||||
|
20
xutil.c
20
xutil.c
@ -90,9 +90,23 @@ xu_key_grab(Window win, int mask, int keysym)
|
||||
mask |= ShiftMask;
|
||||
|
||||
for (i = 0; i < sizeof(ign_mods)/sizeof(*ign_mods); i++)
|
||||
XGrabKey(X_Dpy, XKeysymToKeycode(X_Dpy, keysym),
|
||||
(mask | ign_mods[i]), win, True, GrabModeAsync,
|
||||
GrabModeAsync);
|
||||
XGrabKey(X_Dpy, code, (mask | ign_mods[i]), win,
|
||||
True, GrabModeAsync, GrabModeAsync);
|
||||
}
|
||||
|
||||
void
|
||||
xu_key_ungrab(Window win, int mask, int keysym)
|
||||
{
|
||||
KeyCode code;
|
||||
int i;
|
||||
|
||||
code = XKeysymToKeycode(X_Dpy, keysym);
|
||||
if ((XKeycodeToKeysym(X_Dpy, code, 0) != keysym) &&
|
||||
(XKeycodeToKeysym(X_Dpy, code, 1) == keysym))
|
||||
mask |= ShiftMask;
|
||||
|
||||
for (i = 0; i < sizeof(ign_mods)/sizeof(*ign_mods); i++)
|
||||
XUngrabKey(X_Dpy, code, (mask | ign_mods[i]), win);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user