From d7b03c0c61f481fe1479c39a9b620a1a7c2f3784 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 4 Feb 2019 13:16:00 -0800 Subject: [PATCH 1/2] feat: support capslock as accelerator --- atom/common/keyboard_util.cc | 2 ++ docs/api/accelerator.md | 1 + 2 files changed, 3 insertions(+) diff --git a/atom/common/keyboard_util.cc b/atom/common/keyboard_util.cc index 678e0a24586cd..ce0a48fcec4e2 100644 --- a/atom/common/keyboard_util.cc +++ b/atom/common/keyboard_util.cc @@ -38,6 +38,8 @@ 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 == "tab") { return ui::VKEY_TAB; } else if (str == "num0") { diff --git a/docs/api/accelerator.md b/docs/api/accelerator.md index da73c514133cf..7f6ac1a7cb175 100644 --- a/docs/api/accelerator.md +++ b/docs/api/accelerator.md @@ -58,6 +58,7 @@ The `Super` key is mapped to the `Windows` key on Windows and Linux and * `Plus` * `Space` * `Tab` +* `Capslock` * `Backspace` * `Delete` * `Insert` From f207632c9812aa962ed55516f60c6a9c7ec97dde Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 4 Feb 2019 14:00:14 -0800 Subject: [PATCH 2/2] also add numlock --- atom/common/keyboard_util.cc | 2 ++ docs/api/accelerator.md | 1 + 2 files changed, 3 insertions(+) diff --git a/atom/common/keyboard_util.cc b/atom/common/keyboard_util.cc index ce0a48fcec4e2..f9f3f9aea521e 100644 --- a/atom/common/keyboard_util.cc +++ b/atom/common/keyboard_util.cc @@ -40,6 +40,8 @@ ui::KeyboardCode KeyboardCodeFromKeyIdentifier(const std::string& s, 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 7f6ac1a7cb175..1fda1fe872e85 100644 --- a/docs/api/accelerator.md +++ b/docs/api/accelerator.md @@ -59,6 +59,7 @@ The `Super` key is mapped to the `Windows` key on Windows and Linux and * `Space` * `Tab` * `Capslock` +* `Numlock` * `Backspace` * `Delete` * `Insert`