From 698d348168e727b238969cd7201ac61efbadda0e Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 4 Feb 2019 15:54:59 -0800 Subject: [PATCH] feat: support capslock and numlock as accelerators (#16719) * feat: support capslock as accelerator * also add numlock --- atom/common/keyboard_util.cc | 4 ++++ docs/api/accelerator.md | 2 ++ 2 files changed, 6 insertions(+) diff --git a/atom/common/keyboard_util.cc b/atom/common/keyboard_util.cc index 678e0a24586cd..f9f3f9aea521e 100644 --- a/atom/common/keyboard_util.cc +++ b/atom/common/keyboard_util.cc @@ -38,6 +38,10 @@ ui::KeyboardCode KeyboardCodeFromKeyIdentifier(const std::string& s, } else if (str == "plus") { *shifted = true; return ui::VKEY_OEM_PLUS; + } else if (str == "capslock") { + return ui::VKEY_CAPITAL; + } else if (str == "numlock") { + return ui::VKEY_NUMLOCK; } else if (str == "tab") { return ui::VKEY_TAB; } else if (str == "num0") { diff --git a/docs/api/accelerator.md b/docs/api/accelerator.md index da73c514133cf..1fda1fe872e85 100644 --- a/docs/api/accelerator.md +++ b/docs/api/accelerator.md @@ -58,6 +58,8 @@ The `Super` key is mapped to the `Windows` key on Windows and Linux and * `Plus` * `Space` * `Tab` +* `Capslock` +* `Numlock` * `Backspace` * `Delete` * `Insert`