зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1529466 - Make `TextInputHandler::HandleCommand()` dispatch `keydown`/`keypress` events for emulating `Tab` key when `insertTab:` or `intertBacktab:` command is received r=m_kato
`TextInputHandler::HandleCommand()` dispatches `Tab` key events only when it receives `insertTab:` or `intertBacktab:` command which are caused by actual `Tab` key press. However, these commands could be generated by IME or the system shortcut keys are customized oddly. This patch makes the method support such situation with dispatching fake `keydown` and `keypress` events to emulate `Tab` key press for mainly focus navigation. Differential Revision: https://phabricator.services.mozilla.com/D20804 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
da3a46f861
Коммит
249269b4ff
|
@ -2642,6 +2642,16 @@ bool TextInputHandler::HandleCommand(Command aCommand) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case CommandInsertTab:
|
||||
case CommandInsertBacktab:
|
||||
nsCocoaUtils::InitInputEvent(keypressEvent, keyEvent);
|
||||
keypressEvent.mKeyCode = NS_VK_TAB;
|
||||
keypressEvent.mKeyNameIndex = KEY_NAME_INDEX_Tab;
|
||||
keypressEvent.mModifiers &= ~(MODIFIER_CONTROL | MODIFIER_ALT | MODIFIER_META);
|
||||
if (aCommand == CommandInsertBacktab) {
|
||||
keypressEvent.mModifiers |= MODIFIER_SHIFT;
|
||||
}
|
||||
break;
|
||||
case CommandDeleteCharBackward:
|
||||
case CommandDeleteToBeginningOfLine:
|
||||
case CommandDeleteWordBackward: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче