feat: add numpad accelerator strings (#15689)

This commit is contained in:
Shelley Vohr 2018-11-14 14:02:18 -05:00 committed by GitHub
parent 787dbbe610
commit 511dc9a80b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 1 deletions

View file

@ -40,6 +40,36 @@ ui::KeyboardCode KeyboardCodeFromKeyIdentifier(const std::string& s,
return ui::VKEY_OEM_PLUS; return ui::VKEY_OEM_PLUS;
} else if (str == "tab") { } else if (str == "tab") {
return ui::VKEY_TAB; return ui::VKEY_TAB;
} else if (str == "num0") {
return ui::VKEY_NUMPAD0;
} else if (str == "num1") {
return ui::VKEY_NUMPAD1;
} else if (str == "num2") {
return ui::VKEY_NUMPAD2;
} else if (str == "num3") {
return ui::VKEY_NUMPAD3;
} else if (str == "num4") {
return ui::VKEY_NUMPAD4;
} else if (str == "num5") {
return ui::VKEY_NUMPAD5;
} else if (str == "num6") {
return ui::VKEY_NUMPAD6;
} else if (str == "num7") {
return ui::VKEY_NUMPAD7;
} else if (str == "num8") {
return ui::VKEY_NUMPAD8;
} else if (str == "num9") {
return ui::VKEY_NUMPAD9;
} else if (str == "numadd") {
return ui::VKEY_ADD;
} else if (str == "nummult") {
return ui::VKEY_MULTIPLY;
} else if (str == "numdec") {
return ui::VKEY_DECIMAL;
} else if (str == "numsub") {
return ui::VKEY_SUBTRACT;
} else if (str == "numdiv") {
return ui::VKEY_DIVIDE;
} else if (str == "space") { } else if (str == "space") {
return ui::VKEY_SPACE; return ui::VKEY_SPACE;
} else if (str == "backspace") { } else if (str == "backspace") {
@ -118,7 +148,6 @@ ui::KeyboardCode KeyboardCodeFromCharCode(base::char16 c, bool* shifted) {
return ui::VKEY_ESCAPE; return ui::VKEY_ESCAPE;
case ' ': case ' ':
return ui::VKEY_SPACE; return ui::VKEY_SPACE;
case 'a': case 'a':
return ui::VKEY_A; return ui::VKEY_A;
case 'b': case 'b':

View file

@ -69,3 +69,10 @@ The `Super` key is mapped to the `Windows` key on Windows and Linux and
* `VolumeUp`, `VolumeDown` and `VolumeMute` * `VolumeUp`, `VolumeDown` and `VolumeMute`
* `MediaNextTrack`, `MediaPreviousTrack`, `MediaStop` and `MediaPlayPause` * `MediaNextTrack`, `MediaPreviousTrack`, `MediaStop` and `MediaPlayPause`
* `PrintScreen` * `PrintScreen`
* NumPad Keys
* `num0` - `num9`
* `numdec` - decimal key
* `numadd` - numpad `+` key
* `numsub` - numpad `-` key
* `nummult` - numpad `*` key
* `numdiv` - numpad `÷` key