mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-11-25 19:51:10 +01:00
Do not eat escape key events in onKeyPreIme()
The original reason for intercepting the escape key in onKeyPreIme() was to prevent the escape key as being treated as the Back key before reaching onKeyDown(). This seems no long necessary, and may mess up handling the ...+1 combination for escape on the Google Pixel C keyboard (see #27).
This commit is contained in:
parent
dd38965c46
commit
e006e36dd0
1 changed files with 2 additions and 3 deletions
|
|
@ -491,9 +491,8 @@ public final class TerminalView extends View {
|
|||
@Override
|
||||
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
|
||||
if (LOG_KEY_EVENTS) Log.i(EmulatorDebug.LOG_TAG, "onKeyPreIme(keyCode=" + keyCode + ", event=" + event + ")");
|
||||
if (keyCode == KeyEvent.KEYCODE_ESCAPE || (keyCode == KeyEvent.KEYCODE_BACK && mOnKeyListener.shouldBackButtonBeMappedToEscape())) {
|
||||
// Handle the escape key ourselves to avoid the system from treating it as back key
|
||||
// and e.g. close keyboard.
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && mOnKeyListener.shouldBackButtonBeMappedToEscape()) {
|
||||
// Intercept back button to treat it as escape:
|
||||
switch (event.getAction()) {
|
||||
case KeyEvent.ACTION_DOWN:
|
||||
return onKeyDown(keyCode, event);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue