Skip to content

Commit fa2b880

Browse files
authored
adding support for numpad 'clear' key (#166)
* adding support for numpad 'clear' key * adding CLEAR keycode for x11 per https://github.com/nut-tree/libnut-core/pull/166/files/85993173f6034226603ca1ae0b77d26c439426e0\#r1243154171
1 parent 124d71e commit fa2b880

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/keycode.h

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ enum _MMKeyCode {
7979
K_SUBTRACT = kVK_ANSI_KeypadMinus,
8080
K_DIVIDE = kVK_ANSI_KeypadDivide,
8181
K_MULTIPLY = kVK_ANSI_KeypadMultiply,
82+
K_CLEAR = kVK_ANSI_KeypadClear,
8283

8384
K_NUMPAD_0 = kVK_ANSI_Keypad0,
8485
K_NUMPAD_1 = kVK_ANSI_Keypad1,
@@ -183,6 +184,7 @@ enum _MMKeyCode {
183184
K_SUBTRACT = XK_KP_Subtract,
184185
K_DIVIDE = XK_KP_Divide,
185186
K_MULTIPLY = XK_KP_Multiply,
187+
K_CLEAR = XK_Clear,
186188

187189
K_NUMPAD_0 = XK_KP_0,
188190
K_NUMPAD_1 = XK_KP_1,
@@ -284,6 +286,7 @@ enum _MMKeyCode {
284286
K_SUBTRACT = VK_SUBTRACT,
285287
K_DIVIDE = VK_DIVIDE,
286288
K_MULTIPLY = VK_MULTIPLY,
289+
K_CLEAR = VK_CLEAR,
287290

288291
K_NUMPAD_0 = VK_NUMPAD0,
289292
K_NUMPAD_1 = VK_NUMPAD1,

src/main.cc

+2
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,13 @@ static KeyNames key_names[] =
304304
{"subtract", K_SUBTRACT},
305305
{"multiply", K_MULTIPLY},
306306
{"divide", K_DIVIDE},
307+
{"clear", K_CLEAR},
307308

308309
{"add", K_ADD},
309310
{"subtract", K_SUBTRACT},
310311
{"multiply", K_MULTIPLY},
311312
{"divide", K_DIVIDE},
313+
{"clear", K_CLEAR},
312314

313315
{"lights_mon_up", K_LIGHTS_MON_UP},
314316
{"lights_mon_down", K_LIGHTS_MON_DOWN},

0 commit comments

Comments
 (0)