fix: keep shifted character in menu accelerator (#29202)
* fix: correctly handle shifted char in accelerator * test: use actual accelerator of NSMenuItem * chore: simplify KeyboardCodeFromStr * chore: GetAcceleratorTextAt is testing only
This commit is contained in:
parent
31190d4c6d
commit
3cfe5c6a21
11 changed files with 168 additions and 83 deletions
|
@ -186,10 +186,10 @@ bool Converter<blink::WebKeyboardEvent>::FromV8(v8::Isolate* isolate,
|
|||
if (!dict.Get("keyCode", &str))
|
||||
return false;
|
||||
|
||||
bool shifted = false;
|
||||
ui::KeyboardCode keyCode = electron::KeyboardCodeFromStr(str, &shifted);
|
||||
base::Optional<char16_t> shifted_char;
|
||||
ui::KeyboardCode keyCode = electron::KeyboardCodeFromStr(str, &shifted_char);
|
||||
out->windows_key_code = keyCode;
|
||||
if (shifted)
|
||||
if (shifted_char)
|
||||
out->SetModifiers(out->GetModifiers() |
|
||||
blink::WebInputEvent::Modifiers::kShiftKey);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue