Skip to content

Commit

Permalink
adding support for numpad 'clear' key (#166)
Browse files Browse the repository at this point in the history
* adding support for numpad 'clear' key

* adding CLEAR keycode for x11 per https://github.com/nut-tree/libnut-core/pull/166/files/85993173f6034226603ca1ae0b77d26c439426e0\#r1243154171
  • Loading branch information
smithkyle authored Jun 28, 2023
1 parent 124d71e commit fa2b880
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/keycode.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ enum _MMKeyCode {
K_SUBTRACT = kVK_ANSI_KeypadMinus,
K_DIVIDE = kVK_ANSI_KeypadDivide,
K_MULTIPLY = kVK_ANSI_KeypadMultiply,
K_CLEAR = kVK_ANSI_KeypadClear,

K_NUMPAD_0 = kVK_ANSI_Keypad0,
K_NUMPAD_1 = kVK_ANSI_Keypad1,
Expand Down Expand Up @@ -183,6 +184,7 @@ enum _MMKeyCode {
K_SUBTRACT = XK_KP_Subtract,
K_DIVIDE = XK_KP_Divide,
K_MULTIPLY = XK_KP_Multiply,
K_CLEAR = XK_Clear,

K_NUMPAD_0 = XK_KP_0,
K_NUMPAD_1 = XK_KP_1,
Expand Down Expand Up @@ -284,6 +286,7 @@ enum _MMKeyCode {
K_SUBTRACT = VK_SUBTRACT,
K_DIVIDE = VK_DIVIDE,
K_MULTIPLY = VK_MULTIPLY,
K_CLEAR = VK_CLEAR,

K_NUMPAD_0 = VK_NUMPAD0,
K_NUMPAD_1 = VK_NUMPAD1,
Expand Down
2 changes: 2 additions & 0 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,13 @@ static KeyNames key_names[] =
{"subtract", K_SUBTRACT},
{"multiply", K_MULTIPLY},
{"divide", K_DIVIDE},
{"clear", K_CLEAR},

{"add", K_ADD},
{"subtract", K_SUBTRACT},
{"multiply", K_MULTIPLY},
{"divide", K_DIVIDE},
{"clear", K_CLEAR},

{"lights_mon_up", K_LIGHTS_MON_UP},
{"lights_mon_down", K_LIGHTS_MON_DOWN},
Expand Down

0 comments on commit fa2b880

Please sign in to comment.