summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-02-19 01:08:02 -0800
committerJeff Brown <jeffbrown@google.com>2011-02-19 05:23:10 -0800
commit6f2fba428ca5e77a26d991ad728e346cc47609ee (patch)
tree5dd07c24bd9b474ccfbcba4f63e078598fbd2b50 /policy
parentb1bdb64d641ac63097619e5ef08d5a25bfdc61bb (diff)
downloadframeworks_base-6f2fba428ca5e77a26d991ad728e346cc47609ee.zip
frameworks_base-6f2fba428ca5e77a26d991ad728e346cc47609ee.tar.gz
frameworks_base-6f2fba428ca5e77a26d991ad728e346cc47609ee.tar.bz2
Add new axes for joysticks and mouse wheels.
Added API on InputDevice to query the set of axes available. Added API on KeyEvent and MotionEvent to convert keycodes and axes to symbolic name strings for diagnostic purposes. Added API on KeyEvent to query if a given key code is a gamepad button. Added a new "axis" element to key layout files to specify the mapping between raw absolute axis values and motion axis ids. Expanded the axis bitfield to 64bits to allow for future growth. Modified the Makefile for keyboard prebuilts to run the keymap validation tool during the build. Added layouts for two game controllers. Added default actions for game pad button keys. Added more tests. Fixed a bunch of bugs. Change-Id: I73f9166c3b3c5bcf4970845b58088ad467525525
Diffstat (limited to 'policy')
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 066daa8..c921425 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -117,6 +117,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
import static android.view.WindowManager.LayoutParams.TYPE_POINTER;
import android.view.WindowManagerImpl;
import android.view.WindowManagerPolicy;
+import android.view.KeyCharacterMap.FallbackAction;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.media.IAudioService;
@@ -1453,7 +1454,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
// Check for fallback actions.
- if (kcm.getFallbackAction(keyCode, metaState, mFallbackAction)) {
+ if (getFallbackAction(kcm, keyCode, metaState, mFallbackAction)) {
if (DEBUG_FALLBACK) {
Slog.d(TAG, "Fallback: keyCode=" + mFallbackAction.keyCode
+ " metaState=" + Integer.toHexString(mFallbackAction.metaState));
@@ -1485,6 +1486,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return null;
}
+ private boolean getFallbackAction(KeyCharacterMap kcm, int keyCode, int metaState,
+ FallbackAction outFallbackAction) {
+ // Consult the key character map for specific fallback actions.
+ // For example, map NUMPAD_1 to MOVE_HOME when NUMLOCK is not pressed.
+ if (kcm.getFallbackAction(keyCode, metaState, outFallbackAction)) {
+ return true;
+ }
+ return false;
+ }
+
/**
* A home key -> launch home action was detected. Take the appropriate action
* given the situation with the keyguard.