Xinqi Bao's Git
projects
/
dwm.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
9eef9f7
)
added mappingnotify event for kb refreshes
author
Anselm R.Garbe <
[email protected]
>
Mon, 14 Aug 2006 14:08:52 +0000
(16:08 +0200)
committer
Anselm R.Garbe <
[email protected]
>
Mon, 14 Aug 2006 14:08:52 +0000
(16:08 +0200)
event.c
diff
|
blob
|
history
diff --git
a/event.c
b/event.c
index
1e077fa
..
85205d9
100644
(file)
--- a/
event.c
+++ b/
event.c
@@
-276,6
+276,16
@@
leavenotify(XEvent *e)
}
}
}
}
+static void
+mappingnotify(XEvent *e)
+{
+ XMappingEvent *ev = &e->xmapping;
+
+ XRefreshKeyboardMapping(ev);
+ if(ev->request == MappingKeyboard)
+ grabkeys();
+}
+
static void
maprequest(XEvent *e)
{
static void
maprequest(XEvent *e)
{
@@
-348,6
+358,7
@@
void (*handler[LASTEvent]) (XEvent *) = {
[LeaveNotify] = leavenotify,
[Expose] = expose,
[KeyPress] = keypress,
[LeaveNotify] = leavenotify,
[Expose] = expose,
[KeyPress] = keypress,
+ [MappingNotify] = mappingnotify,
[MapRequest] = maprequest,
[PropertyNotify] = propertynotify,
[UnmapNotify] = unmapnotify
[MapRequest] = maprequest,
[PropertyNotify] = propertynotify,
[UnmapNotify] = unmapnotify
@@
-360,6
+371,7
@@
grabkeys()
unsigned int i;
KeyCode code;
unsigned int i;
KeyCode code;
+ XUngrabKey(dpy, AnyKey, AnyModifier, root);
for(i = 0; i < len; i++) {
code = XKeysymToKeycode(dpy, key[i].keysym);
XGrabKey(dpy, code, key[i].mod, root, True,
for(i = 0; i < len; i++) {
code = XKeysymToKeycode(dpy, key[i].keysym);
XGrabKey(dpy, code, key[i].mod, root, True,