From aa1a94daaa59e98303fdeb1c3066b60a58755dff Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Thu, 26 Nov 2015 16:04:54 +0000 Subject: Make KEYCODE_SPACE a confirm key. By default space should "click" the focused item. This behavior also applies to GridView and ListView if the items are clickable, but will continue the previous behavior of scrolling if it's just a list of items you can't really interact with. Change-Id: Ic3a0334614d1dc68ff98bc4b1fb1ae2f961f71af --- core/java/android/view/View.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/java/android/view/View.java') diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 6dd87a035d23..9f5cfa8dc3d7 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -10173,8 +10173,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Default implementation of {@link KeyEvent.Callback#onKeyUp(int, KeyEvent) * KeyEvent.Callback.onKeyUp()}: perform clicking of the view - * when {@link KeyEvent#KEYCODE_DPAD_CENTER} or - * {@link KeyEvent#KEYCODE_ENTER} is released. + * when {@link KeyEvent#KEYCODE_DPAD_CENTER}, {@link KeyEvent#KEYCODE_ENTER} + * or {@link KeyEvent#KEYCODE_SPACE} is released. *

Key presses in software keyboards will generally NOT trigger this listener, * although some may elect to do so in some situations. Do not rely on this to * catch software key presses. -- cgit v1.2.3