Browse Source

feat: support capslock and numlock as accelerators (#16719)

* feat: support capslock as accelerator

* also add numlock
Shelley Vohr 6 years ago
parent
commit
698d348168
2 changed files with 6 additions and 0 deletions
  1. 4 0
      atom/common/keyboard_util.cc
  2. 2 0
      docs/api/accelerator.md

+ 4 - 0
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") {

+ 2 - 0
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`