am 1f762b34: am 9aa7c6e5: am e4a71792: am 4448f9d7: am c5dea68e: Merge "Revert Japanese special case fallback keys." into klp-dev
* commit '1f762b3490ce3583354ac3bf23732e88ebdb7b81': Revert Japanese special case fallback keys.
This commit is contained in:
@@ -232,8 +232,6 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
InputStage mFirstInputStage;
|
InputStage mFirstInputStage;
|
||||||
InputStage mFirstPostImeInputStage;
|
InputStage mFirstPostImeInputStage;
|
||||||
|
|
||||||
boolean mFlipControllerFallbackKeys;
|
|
||||||
|
|
||||||
boolean mWindowAttributesChanged = false;
|
boolean mWindowAttributesChanged = false;
|
||||||
int mWindowAttributesChangesFlag = 0;
|
int mWindowAttributesChangesFlag = 0;
|
||||||
|
|
||||||
@@ -370,8 +368,6 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
mNoncompatDensity = context.getResources().getDisplayMetrics().noncompatDensityDpi;
|
mNoncompatDensity = context.getResources().getDisplayMetrics().noncompatDensityDpi;
|
||||||
mFallbackEventHandler = PolicyManager.makeNewFallbackEventHandler(context);
|
mFallbackEventHandler = PolicyManager.makeNewFallbackEventHandler(context);
|
||||||
mChoreographer = Choreographer.getInstance();
|
mChoreographer = Choreographer.getInstance();
|
||||||
mFlipControllerFallbackKeys =
|
|
||||||
context.getResources().getBoolean(R.bool.flip_controller_fallback_keys);
|
|
||||||
|
|
||||||
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
mAttachInfo.mScreenOn = powerManager.isScreenOn();
|
mAttachInfo.mScreenOn = powerManager.isScreenOn();
|
||||||
@@ -2912,11 +2908,8 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
mView.dispatchConfigurationChanged(config);
|
mView.dispatchConfigurationChanged(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mFlipControllerFallbackKeys =
|
|
||||||
mContext.getResources().getBoolean(R.bool.flip_controller_fallback_keys);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if child is an ancestor of parent, (or equal to the parent).
|
* Return true if child is an ancestor of parent, (or equal to the parent).
|
||||||
*/
|
*/
|
||||||
@@ -3985,7 +3978,6 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
private final SyntheticJoystickHandler mJoystick = new SyntheticJoystickHandler();
|
private final SyntheticJoystickHandler mJoystick = new SyntheticJoystickHandler();
|
||||||
private final SyntheticTouchNavigationHandler mTouchNavigation =
|
private final SyntheticTouchNavigationHandler mTouchNavigation =
|
||||||
new SyntheticTouchNavigationHandler();
|
new SyntheticTouchNavigationHandler();
|
||||||
private final SyntheticKeyHandler mKeys = new SyntheticKeyHandler();
|
|
||||||
|
|
||||||
public SyntheticInputStage() {
|
public SyntheticInputStage() {
|
||||||
super(null);
|
super(null);
|
||||||
@@ -4008,12 +4000,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
mTouchNavigation.process(event);
|
mTouchNavigation.process(event);
|
||||||
return FINISH_HANDLED;
|
return FINISH_HANDLED;
|
||||||
}
|
}
|
||||||
} else if (q.mEvent instanceof KeyEvent) {
|
|
||||||
if (mKeys.process((KeyEvent) q.mEvent)) {
|
|
||||||
return FINISH_HANDLED;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FORWARD;
|
return FORWARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4843,63 +4830,6 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
final class SyntheticKeyHandler {
|
|
||||||
|
|
||||||
public boolean process(KeyEvent event) {
|
|
||||||
// In some locales (like Japan) controllers use B for confirm and A for back, rather
|
|
||||||
// than vice versa, so we need to special case this here since the input system itself
|
|
||||||
// is not locale-aware.
|
|
||||||
int keyCode;
|
|
||||||
switch(event.getKeyCode()) {
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_A:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_C:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_X:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_Z:
|
|
||||||
keyCode = mFlipControllerFallbackKeys ?
|
|
||||||
KeyEvent.KEYCODE_BACK : KeyEvent.KEYCODE_DPAD_CENTER;
|
|
||||||
break;
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_B:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_Y:
|
|
||||||
keyCode = mFlipControllerFallbackKeys ?
|
|
||||||
KeyEvent.KEYCODE_DPAD_CENTER : KeyEvent.KEYCODE_BACK;
|
|
||||||
break;
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_THUMBL:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_THUMBR:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_START:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_1:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_2:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_3:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_4:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_5:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_6:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_7:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_8:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_9:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_10:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_11:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_12:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_13:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_14:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_15:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_16:
|
|
||||||
keyCode = KeyEvent.KEYCODE_DPAD_CENTER;
|
|
||||||
break;
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_SELECT:
|
|
||||||
case KeyEvent.KEYCODE_BUTTON_MODE:
|
|
||||||
keyCode = KeyEvent.KEYCODE_MENU;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
enqueueInputEvent(new KeyEvent(event.getDownTime(), event.getEventTime(),
|
|
||||||
event.getAction(), keyCode, event.getRepeatCount(), event.getMetaState(),
|
|
||||||
event.getDeviceId(), event.getScanCode(),
|
|
||||||
event.getFlags() | KeyEvent.FLAG_FALLBACK, event.getSource()));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the key is used for keyboard navigation.
|
* Returns true if the key is used for keyboard navigation.
|
||||||
* @param keyEvent The key event.
|
* @param keyEvent The key event.
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2013 The Android Open Source Project
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<resources>
|
|
||||||
<bool name="flip_controller_fallback_keys">true</bool>
|
|
||||||
</resources>
|
|
||||||
|
|
||||||
@@ -26,5 +26,4 @@
|
|||||||
<bool name="show_ongoing_ime_switcher">true</bool>
|
<bool name="show_ongoing_ime_switcher">true</bool>
|
||||||
<bool name="action_bar_expanded_action_views_exclusive">true</bool>
|
<bool name="action_bar_expanded_action_views_exclusive">true</bool>
|
||||||
<bool name="target_honeycomb_needs_options_menu">true</bool>
|
<bool name="target_honeycomb_needs_options_menu">true</bool>
|
||||||
<bool name="flip_controller_fallback_keys">false</bool>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -288,7 +288,6 @@
|
|||||||
<java-symbol type="bool" name="config_useFixedVolume" />
|
<java-symbol type="bool" name="config_useFixedVolume" />
|
||||||
<java-symbol type="bool" name="config_forceDefaultOrientation" />
|
<java-symbol type="bool" name="config_forceDefaultOrientation" />
|
||||||
<java-symbol type="bool" name="config_wifi_batched_scan_supported" />
|
<java-symbol type="bool" name="config_wifi_batched_scan_supported" />
|
||||||
<java-symbol type="bool" name="flip_controller_fallback_keys" />
|
|
||||||
|
|
||||||
<java-symbol type="integer" name="config_cursorWindowSize" />
|
<java-symbol type="integer" name="config_cursorWindowSize" />
|
||||||
<java-symbol type="integer" name="config_extraFreeKbytesAdjust" />
|
<java-symbol type="integer" name="config_extraFreeKbytesAdjust" />
|
||||||
|
|||||||
@@ -477,4 +477,128 @@ key ESCAPE {
|
|||||||
ctrl: fallback MENU
|
ctrl: fallback MENU
|
||||||
}
|
}
|
||||||
|
|
||||||
### Gamepad buttons are handled by the view root ###
|
### Gamepad buttons ###
|
||||||
|
|
||||||
|
key BUTTON_A {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_B {
|
||||||
|
base: fallback BACK
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_C {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_X {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_Y {
|
||||||
|
base: fallback BACK
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_Z {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_L1 {
|
||||||
|
base: none
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_R1 {
|
||||||
|
base: none
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_L2 {
|
||||||
|
base: none
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_R2 {
|
||||||
|
base: none
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_THUMBL {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_THUMBR {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_START {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_SELECT {
|
||||||
|
base: fallback MENU
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_MODE {
|
||||||
|
base: fallback MENU
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_1 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_2 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_3 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_4 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_5 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_6 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_7 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_8 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_9 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_10 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_11 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_12 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_13 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_14 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_15 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|
||||||
|
key BUTTON_16 {
|
||||||
|
base: fallback DPAD_CENTER
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user