mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 479942 When physical space key is pressed, we should guarantee that it works as ' ' input key with any keyboard layout at handling shortcut key or access key r=karlt
This commit is contained in:
parent
12c3bcae38
commit
4208a9ff5d
@ -4639,6 +4639,16 @@ nsContentUtils::GetAccelKeyCandidates(nsIDOMKeyEvent* aDOMKeyEvent,
|
||||
aCandidates.AppendElement(key);
|
||||
}
|
||||
}
|
||||
|
||||
// Special case for "Space" key. With some keyboard layouts, "Space" with
|
||||
// or without Shift key causes non-ASCII space. For such keyboard layouts,
|
||||
// we should guarantee that the key press works as an ASCII white space key
|
||||
// press.
|
||||
if (nativeKeyEvent->mCodeNameIndex == CODE_NAME_INDEX_Space &&
|
||||
nativeKeyEvent->charCode != static_cast<uint32_t>(' ')) {
|
||||
nsShortcutCandidate spaceKey(static_cast<uint32_t>(' '), false);
|
||||
aCandidates.AppendElement(spaceKey);
|
||||
}
|
||||
} else {
|
||||
uint32_t charCode;
|
||||
aDOMKeyEvent->GetCharCode(&charCode);
|
||||
@ -4681,6 +4691,14 @@ nsContentUtils::GetAccessKeyCandidates(WidgetKeyboardEvent* aNativeKeyEvent,
|
||||
aCandidates.AppendElement(ch[j]);
|
||||
}
|
||||
}
|
||||
// Special case for "Space" key. With some keyboard layouts, "Space" with
|
||||
// or without Shift key causes non-ASCII space. For such keyboard layouts,
|
||||
// we should guarantee that the key press works as an ASCII white space key
|
||||
// press.
|
||||
if (aNativeKeyEvent->mCodeNameIndex == CODE_NAME_INDEX_Space &&
|
||||
aNativeKeyEvent->charCode != static_cast<uint32_t>(' ')) {
|
||||
aCandidates.AppendElement(static_cast<uint32_t>(' '));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user