mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Fix bug 287866: let the escape key cancel IME input if there is marked text. Patch by waverider (waveridervsnrz@yahoo.co.jp).
This commit is contained in:
parent
46ffd47447
commit
696cc43473
@ -65,9 +65,12 @@ static const int kEscapeKeyCode = 53;
|
||||
// We need this hack because NSWindow::sendEvent will eat the escape key
|
||||
// and won't pass it down to the key handler of responders in the window.
|
||||
// We have to override sendEvent for all of our escape key needs.
|
||||
// If IME is on, let the event propagate.
|
||||
// Revert the URL field if it is the first responder, attempt to stop page
|
||||
// load otherwise.
|
||||
if ([theEvent type] == NSKeyDown && [theEvent keyCode] == kEscapeKeyCode) {
|
||||
if ([theEvent type] == NSKeyDown &&
|
||||
[theEvent keyCode] == kEscapeKeyCode &&
|
||||
![[NSInputManager currentInputManager] hasMarkedText]) {
|
||||
if ([self firstResponder] == [mAutoCompleteTextField fieldEditor])
|
||||
[mAutoCompleteTextField revertText];
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user