Loading core/java/android/view/ViewRootImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -3330,8 +3330,9 @@ public final class ViewRootImpl extends Handler implements ViewParent, } // If the Control modifier is held, try to interpret the key as a shortcut. if (event.getAction() == KeyEvent.ACTION_UP if (event.getAction() == KeyEvent.ACTION_DOWN && event.isCtrlPressed() && event.getRepeatCount() == 0 && !KeyEvent.isModifierKey(event.getKeyCode())) { if (mView.dispatchKeyShortcutEvent(event)) { finishKeyEvent(event, sendDone, true); Loading policy/src/com/android/internal/policy/impl/PhoneWindow.java +31 −11 Original line number Diff line number Diff line Loading @@ -1816,10 +1816,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @Override public boolean dispatchKeyShortcutEvent(KeyEvent ev) { // Perform the shortcut (mPreparedPanel can be null since // global shortcuts (such as search) don't rely on a // prepared panel or menu). boolean handled = performPanelShortcut(mPreparedPanel, ev.getKeyCode(), ev, // If the panel is already prepared, then perform the shortcut using it. boolean handled; if (mPreparedPanel != null) { handled = performPanelShortcut(mPreparedPanel, ev.getKeyCode(), ev, Menu.FLAG_PERFORM_NO_CLOSE); if (handled) { if (mPreparedPanel != null) { Loading @@ -1827,11 +1827,31 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } return true; } } // Shortcut not handled by the panel. Dispatch to the view hierarchy. final Callback cb = getCallback(); return cb != null && !isDestroyed() && mFeatureId < 0 ? cb.dispatchKeyShortcutEvent(ev) : super.dispatchKeyShortcutEvent(ev); handled = cb != null && !isDestroyed() && mFeatureId < 0 ? cb.dispatchKeyShortcutEvent(ev) : super.dispatchKeyShortcutEvent(ev); if (handled) { return true; } // If the panel is not prepared, then we may be trying to handle a shortcut key // combination such as Control+C. Temporarily prepare the panel then mark it // unprepared again when finished to ensure that the panel will again be prepared // the next time it is shown for real. if (mPreparedPanel == null) { PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, true); preparePanel(st, ev); handled = performPanelShortcut(st, ev.getKeyCode(), ev, Menu.FLAG_PERFORM_NO_CLOSE); st.isPrepared = false; if (handled) { return true; } } return false; } @Override Loading Loading
core/java/android/view/ViewRootImpl.java +2 −1 Original line number Diff line number Diff line Loading @@ -3330,8 +3330,9 @@ public final class ViewRootImpl extends Handler implements ViewParent, } // If the Control modifier is held, try to interpret the key as a shortcut. if (event.getAction() == KeyEvent.ACTION_UP if (event.getAction() == KeyEvent.ACTION_DOWN && event.isCtrlPressed() && event.getRepeatCount() == 0 && !KeyEvent.isModifierKey(event.getKeyCode())) { if (mView.dispatchKeyShortcutEvent(event)) { finishKeyEvent(event, sendDone, true); Loading
policy/src/com/android/internal/policy/impl/PhoneWindow.java +31 −11 Original line number Diff line number Diff line Loading @@ -1816,10 +1816,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @Override public boolean dispatchKeyShortcutEvent(KeyEvent ev) { // Perform the shortcut (mPreparedPanel can be null since // global shortcuts (such as search) don't rely on a // prepared panel or menu). boolean handled = performPanelShortcut(mPreparedPanel, ev.getKeyCode(), ev, // If the panel is already prepared, then perform the shortcut using it. boolean handled; if (mPreparedPanel != null) { handled = performPanelShortcut(mPreparedPanel, ev.getKeyCode(), ev, Menu.FLAG_PERFORM_NO_CLOSE); if (handled) { if (mPreparedPanel != null) { Loading @@ -1827,11 +1827,31 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } return true; } } // Shortcut not handled by the panel. Dispatch to the view hierarchy. final Callback cb = getCallback(); return cb != null && !isDestroyed() && mFeatureId < 0 ? cb.dispatchKeyShortcutEvent(ev) : super.dispatchKeyShortcutEvent(ev); handled = cb != null && !isDestroyed() && mFeatureId < 0 ? cb.dispatchKeyShortcutEvent(ev) : super.dispatchKeyShortcutEvent(ev); if (handled) { return true; } // If the panel is not prepared, then we may be trying to handle a shortcut key // combination such as Control+C. Temporarily prepare the panel then mark it // unprepared again when finished to ensure that the panel will again be prepared // the next time it is shown for real. if (mPreparedPanel == null) { PanelFeatureState st = getPanelState(FEATURE_OPTIONS_PANEL, true); preparePanel(st, ev); handled = performPanelShortcut(st, ev.getKeyCode(), ev, Menu.FLAG_PERFORM_NO_CLOSE); st.isPrepared = false; if (handled) { return true; } } return false; } @Override Loading