diff --git a/genkeys.go b/genkeys.go index 3e6aceb73..7ef53f674 100644 --- a/genkeys.go +++ b/genkeys.go @@ -69,6 +69,7 @@ func init() { "Backslash": {"Backslash"}, "RightBracket": {"BracketRight"}, "GraveAccent": {"Backquote"}, + "NumLock": {"NumLock"}, } // ASCII: 0 - 9 for c := '0'; c <= '9'; c++ { diff --git a/internal/input/keys.go b/internal/input/keys.go index 3f89be1ad..a9b15d4ca 100644 --- a/internal/input/keys.go +++ b/internal/input/keys.go @@ -103,6 +103,7 @@ const ( KeyLeft KeyLeftBracket KeyMinus + KeyNumLock KeyPageDown KeyPageUp KeyPeriod diff --git a/internal/input/keys_glfw.go b/internal/input/keys_glfw.go index 3fd125bb4..e41ae4182 100644 --- a/internal/input/keys_glfw.go +++ b/internal/input/keys_glfw.go @@ -108,6 +108,7 @@ var glfwKeyCodeToKey = map[glfw.Key]Key{ glfw.KeyLeft: KeyLeft, glfw.KeyLeftBracket: KeyLeftBracket, glfw.KeyMinus: KeyMinus, + glfw.KeyNumLock: KeyNumLock, glfw.KeyPageDown: KeyPageDown, glfw.KeyPageUp: KeyPageUp, glfw.KeyPeriod: KeyPeriod, diff --git a/internal/input/keys_js.go b/internal/input/keys_js.go index 95f6f8ce4..9a2ad12e7 100644 --- a/internal/input/keys_js.go +++ b/internal/input/keys_js.go @@ -235,6 +235,9 @@ var keyToCodes = map[Key][]string{ KeyN: { "KeyN", }, + KeyNumLock: { + "NumLock", + }, KeyO: { "KeyO", }, diff --git a/keys.go b/keys.go index b0b19bb25..8e9578c5d 100644 --- a/keys.go +++ b/keys.go @@ -113,6 +113,7 @@ const ( KeyLeft Key = Key(input.KeyLeft) KeyLeftBracket Key = Key(input.KeyLeftBracket) KeyMinus Key = Key(input.KeyMinus) + KeyNumLock Key = Key(input.KeyNumLock) KeyPageDown Key = Key(input.KeyPageDown) KeyPageUp Key = Key(input.KeyPageUp) KeyPeriod Key = Key(input.KeyPeriod) @@ -297,6 +298,8 @@ func keyNameToKey(name string) (Key, bool) { return KeyLeftBracket, true case "minus": return KeyMinus, true + case "numlock": + return KeyNumLock, true case "pagedown": return KeyPageDown, true case "pageup":