Merge "Handle spacebar events." into nyc-dev
am: 166639aefa
* commit '166639aefa3dbf21acdb0a35226b05cddd91bd7f':
Handle spacebar events.
This commit is contained in:
@@ -52,6 +52,18 @@ class FocusManager implements View.OnFocusChangeListener {
|
||||
* @return Whether the event was handled.
|
||||
*/
|
||||
public boolean handleKey(DocumentHolder doc, int keyCode, KeyEvent event) {
|
||||
boolean extendSelection = false;
|
||||
// Translate space/shift-space into PgDn/PgUp
|
||||
if (keyCode == KeyEvent.KEYCODE_SPACE) {
|
||||
if (event.isShiftPressed()) {
|
||||
keyCode = KeyEvent.KEYCODE_PAGE_UP;
|
||||
} else {
|
||||
keyCode = KeyEvent.KEYCODE_PAGE_DOWN;
|
||||
}
|
||||
} else {
|
||||
extendSelection = event.isShiftPressed();
|
||||
}
|
||||
|
||||
if (Events.isNavigationKeyCode(keyCode)) {
|
||||
// Find the target item and focus it.
|
||||
int endPos = findTargetPosition(doc.itemView, keyCode, event);
|
||||
|
||||
Reference in New Issue
Block a user