about summary refs log tree commit diff stats
path: root/gridmenu.c
diff options
context:
space:
mode:
authorChris Down <chris@chrisdown.name>2022-12-07 14:55:08 +0000
committerHiltjo Posthuma <hiltjo@codemadness.org>2022-12-07 23:06:26 +0100
commit89f9905714c1c1b2e8b09986dfbeca15b68d8af8 (patch)
tree6cdaa8ca57ad6edb94136a621edc2200245bcbfe /gridmenu.c
parentba56fe9fea0a28d8184a727a987836a0903e2682 (diff)
downloaddwm-89f9905714c1c1b2e8b09986dfbeca15b68d8af8.tar.gz
grabkeys: Avoid missing events when a keysym maps to multiple keycodes
It's not uncommon for one keysym to map to multiple keycodes. For
example, the "play" button on my keyboard sends keycode 172, but my
bluetooth headphones send keycode 208, both of which map back to
XF86AudioPlay:

    % xmodmap -pke | grep XF86AudioPlay
    keycode 172 = XF86AudioPlay XF86AudioPause XF86AudioPlay XF86AudioPause
    keycode 208 = XF86AudioPlay NoSymbol XF86AudioPlay
    keycode 215 = XF86AudioPlay NoSymbol XF86AudioPlay

This is a problem because the current code only grabs a single one of
these keycodes, which means that events for any other keycode also
mapping to the bound keysym will not be handled by dwm. In my case, this
means that binding XF86AudioPlay does the right thing and correctly
handles my keyboard's keys, but does nothing on my headphones. I'm not
the only person affected by this, there are other reports[0].

In order to fix this, we look at the mappings between keycodes and
keysyms at grabkeys() time and pick out all matching keycodes rather
than just the first one. The keypress() side of this doesn't need any
changes because the keycode gets converted back to a canonical keysym
before any action is taken.

0: https://github.com/cdown/dwm/issues/11
Diffstat (limited to 'gridmenu.c')
0 files changed, 0 insertions, 0 deletions
k/mu/blame/html/024jump.cc.html?h=hlt&id=4690ce81e079fc58cae8d6d583e5e3eb3ed81a83'>^
4c4d325c ^

a654e4ec ^

4690ce81 ^
e5c11a51 ^
3e1349d2 ^
e5c11a51 ^
4690ce81 ^
a654e4ec ^
e5c11a51 ^
3e1349d2 ^
a654e4ec ^
70f4e9b6 ^
672e3e50 ^

a654e4ec ^



e5c11a51 ^






















a654e4ec ^

672e3e50 ^
e5c11a51 ^
a654e4ec ^
204dae92 ^


201458e3 ^
204dae92 ^









201458e3 ^
204dae92 ^

201458e3 ^
fd7d8138 ^
204dae92 ^


fd7d8138 ^
204dae92 ^







fd7d8138 ^
204dae92 ^




201458e3 ^
204dae92 ^

201458e3 ^
204dae92 ^











201458e3 ^
204dae92 ^

201458e3 ^
fd7d8138 ^
204dae92 ^


fd7d8138 ^
204dae92 ^


fd7d8138 ^
204dae92 ^








fd7d8138 ^
204dae92 ^


fd7d8138 ^
204dae92 ^



201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^










201458e3 ^
204dae92 ^

201458e3 ^
fd7d8138 ^
204dae92 ^


fd7d8138 ^
204dae92 ^


fd7d8138 ^
204dae92 ^








fd7d8138 ^
204dae92 ^


fd7d8138 ^
204dae92 ^



201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^



201458e3 ^
204dae92 ^






672e3e50 ^


a654e4ec ^
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221