about summary refs log tree commit diff stats
path: root/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'event.c')
-rw-r--r--event.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/event.c b/event.c
index 1e077fa..85205d9 100644
--- a/event.c
+++ b/event.c
@@ -277,6 +277,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 XWindowAttributes wa;
@@ -348,6 +358,7 @@ void (*handler[LASTEvent]) (XEvent *) = {
 	[LeaveNotify] = leavenotify,
 	[Expose] = expose,
 	[KeyPress] = keypress,
+	[MappingNotify] = mappingnotify,
 	[MapRequest] = maprequest,
 	[PropertyNotify] = propertynotify,
 	[UnmapNotify] = unmapnotify
@@ -360,6 +371,7 @@ grabkeys()
 	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,
m David Barnett, previews work' href='/akspecs/ranger/commit/ranger/gui/ansi.py?id=43e0f44a4788f3251d5f2ad7c1bfeff014353aba'>43e0f44a ^
cfa5ab76 ^







43e0f44a ^






cfa5ab76 ^
43e0f44a ^
cfa5ab76 ^



58752d8a ^

cfa5ab76 ^












7a0f5d2f ^














cfa5ab76 ^

7a0f5d2f ^














1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96