Merge "Exit active mode on Escape key" into udc-dev am: a7b390fe6e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21786920 Change-Id: If814ee08aed1683135aadb9ce01997e619f35950 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -360,6 +360,15 @@ public class QwertyKeyListener extends BaseKeyListener {
|
|||||||
return super.onKeyDown(view, content, keyCode, event);
|
return super.onKeyDown(view, content, keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (keyCode == KeyEvent.KEYCODE_ESCAPE && event.hasNoModifiers()) {
|
||||||
|
// If user is in the process of composing with a dead key, and
|
||||||
|
// presses Escape, cancel it. We need special handling because
|
||||||
|
// the Escape key will not produce a Unicode character
|
||||||
|
if (activeStart == selStart && activeEnd == selEnd) {
|
||||||
|
Selection.setSelection(content, selEnd);
|
||||||
|
content.removeSpan(TextKeyListener.ACTIVE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user