Loading include/ui/InputDispatcher.h +9 −3 Original line number Original line Diff line number Diff line Loading @@ -306,9 +306,10 @@ public: virtual bool interceptKeyBeforeDispatching(const sp<InputChannel>& inputChannel, virtual bool interceptKeyBeforeDispatching(const sp<InputChannel>& inputChannel, const KeyEvent* keyEvent, uint32_t policyFlags) = 0; const KeyEvent* keyEvent, uint32_t policyFlags) = 0; /* Allows the policy a chance to perform default processing for an unhandled key. */ /* Allows the policy a chance to perform default processing for an unhandled key. * Returns an alternate keycode to redispatch as a fallback, or 0 to give up. */ virtual bool dispatchUnhandledKey(const sp<InputChannel>& inputChannel, virtual bool dispatchUnhandledKey(const sp<InputChannel>& inputChannel, const KeyEvent* keyEvent, uint32_t policyFlags) = 0; const KeyEvent* keyEvent, uint32_t policyFlags, KeyEvent* outFallbackKeyEvent) = 0; /* Notifies the policy about switch events. /* Notifies the policy about switch events. */ */ Loading Loading @@ -735,6 +736,7 @@ private: CANCEL_ALL_EVENTS = 0, CANCEL_ALL_EVENTS = 0, CANCEL_POINTER_EVENTS = 1, CANCEL_POINTER_EVENTS = 1, CANCEL_NON_POINTER_EVENTS = 2, CANCEL_NON_POINTER_EVENTS = 2, CANCEL_FALLBACK_EVENTS = 3, }; }; InputState(); InputState(); Loading Loading @@ -771,6 +773,7 @@ private: int32_t source; int32_t source; int32_t keyCode; int32_t keyCode; int32_t scanCode; int32_t scanCode; int32_t flags; nsecs_t downTime; nsecs_t downTime; }; }; Loading @@ -790,7 +793,10 @@ private: Vector<KeyMemento> mKeyMementos; Vector<KeyMemento> mKeyMementos; Vector<MotionMemento> mMotionMementos; Vector<MotionMemento> mMotionMementos; static bool shouldCancelEvent(int32_t eventSource, CancelationOptions options); static bool shouldCancelKey(const KeyMemento& memento, CancelationOptions options); static bool shouldCancelMotion(const MotionMemento& memento, CancelationOptions options); }; }; /* Manages the dispatch state associated with a single input channel. */ /* Manages the dispatch state associated with a single input channel. */ Loading include/ui/InputReader.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -402,7 +402,6 @@ private: } mLocked; } mLocked; void initializeLocked(); void initializeLocked(); void initializeLedStateLocked(LockedState::LedState& ledState, int32_t led); void configureParameters(); void configureParameters(); void dumpParameters(String8& dump); void dumpParameters(String8& dump); Loading @@ -414,6 +413,8 @@ private: ssize_t findKeyDownLocked(int32_t scanCode); ssize_t findKeyDownLocked(int32_t scanCode); void resetLedStateLocked(); void initializeLedStateLocked(LockedState::LedState& ledState, int32_t led); void updateLedStateLocked(bool reset); void updateLedStateLocked(bool reset); void updateLedStateForModifierLocked(LockedState::LedState& ledState, int32_t led, void updateLedStateForModifierLocked(LockedState::LedState& ledState, int32_t led, int32_t modifier, bool reset); int32_t modifier, bool reset); Loading include/ui/InputTransport.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -256,7 +256,7 @@ public: * Returns WOULD_BLOCK if there is no signal present. * Returns WOULD_BLOCK if there is no signal present. * Other errors probably indicate that the channel is broken. * Other errors probably indicate that the channel is broken. */ */ status_t receiveFinishedSignal(bool& outHandled); status_t receiveFinishedSignal(bool* outHandled); private: private: sp<InputChannel> mChannel; sp<InputChannel> mChannel; Loading include/ui/KeyCharacterMap.h +17 −0 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,12 @@ public: KEYBOARD_TYPE_SPECIAL_FUNCTION = 5, KEYBOARD_TYPE_SPECIAL_FUNCTION = 5, }; }; // Substitute key code and meta state for fallback action. struct FallbackAction { int32_t keyCode; int32_t metaState; }; ~KeyCharacterMap(); ~KeyCharacterMap(); static status_t load(const String8& filename, KeyCharacterMap** outMap); static status_t load(const String8& filename, KeyCharacterMap** outMap); Loading @@ -67,6 +73,13 @@ public: */ */ char16_t getCharacter(int32_t keyCode, int32_t metaState) const; char16_t getCharacter(int32_t keyCode, int32_t metaState) const; /* Gets the fallback action to use by default if the application does not * handle the specified key. * Returns true if an action was available, false if none. */ bool getFallbackAction(int32_t keyCode, int32_t metaState, FallbackAction* outFallbackAction) const; /* Gets the first matching Unicode character that can be generated by the key, /* Gets the first matching Unicode character that can be generated by the key, * preferring the one with the specified meta key modifiers. * preferring the one with the specified meta key modifiers. * Returns 0 if no matching character is generated. * Returns 0 if no matching character is generated. Loading Loading @@ -155,6 +168,10 @@ private: KeyCharacterMap(); KeyCharacterMap(); bool getKey(int32_t keyCode, const Key** outKey) const; bool getKeyBehavior(int32_t keyCode, int32_t metaState, const Key** outKey, const Behavior** outBehavior) const; bool findKey(char16_t ch, int32_t* outKeyCode, int32_t* outMetaState) const; bool findKey(char16_t ch, int32_t* outKeyCode, int32_t* outMetaState) const; static void addKey(Vector<KeyEvent>& outEvents, static void addKey(Vector<KeyEvent>& outEvents, Loading include/ui/KeycodeLabels.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -211,6 +211,7 @@ static const KeycodeLabel KEYCODES[] = { { "PROG_GREEN", 184 }, { "PROG_GREEN", 184 }, { "PROG_YELLOW", 185 }, { "PROG_YELLOW", 185 }, { "PROG_BLUE", 186 }, { "PROG_BLUE", 186 }, { "APP_SWITCH", 187 }, // NOTE: If you add a new keycode here you must also add it to several other files. // NOTE: If you add a new keycode here you must also add it to several other files. // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list. // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list. Loading Loading
include/ui/InputDispatcher.h +9 −3 Original line number Original line Diff line number Diff line Loading @@ -306,9 +306,10 @@ public: virtual bool interceptKeyBeforeDispatching(const sp<InputChannel>& inputChannel, virtual bool interceptKeyBeforeDispatching(const sp<InputChannel>& inputChannel, const KeyEvent* keyEvent, uint32_t policyFlags) = 0; const KeyEvent* keyEvent, uint32_t policyFlags) = 0; /* Allows the policy a chance to perform default processing for an unhandled key. */ /* Allows the policy a chance to perform default processing for an unhandled key. * Returns an alternate keycode to redispatch as a fallback, or 0 to give up. */ virtual bool dispatchUnhandledKey(const sp<InputChannel>& inputChannel, virtual bool dispatchUnhandledKey(const sp<InputChannel>& inputChannel, const KeyEvent* keyEvent, uint32_t policyFlags) = 0; const KeyEvent* keyEvent, uint32_t policyFlags, KeyEvent* outFallbackKeyEvent) = 0; /* Notifies the policy about switch events. /* Notifies the policy about switch events. */ */ Loading Loading @@ -735,6 +736,7 @@ private: CANCEL_ALL_EVENTS = 0, CANCEL_ALL_EVENTS = 0, CANCEL_POINTER_EVENTS = 1, CANCEL_POINTER_EVENTS = 1, CANCEL_NON_POINTER_EVENTS = 2, CANCEL_NON_POINTER_EVENTS = 2, CANCEL_FALLBACK_EVENTS = 3, }; }; InputState(); InputState(); Loading Loading @@ -771,6 +773,7 @@ private: int32_t source; int32_t source; int32_t keyCode; int32_t keyCode; int32_t scanCode; int32_t scanCode; int32_t flags; nsecs_t downTime; nsecs_t downTime; }; }; Loading @@ -790,7 +793,10 @@ private: Vector<KeyMemento> mKeyMementos; Vector<KeyMemento> mKeyMementos; Vector<MotionMemento> mMotionMementos; Vector<MotionMemento> mMotionMementos; static bool shouldCancelEvent(int32_t eventSource, CancelationOptions options); static bool shouldCancelKey(const KeyMemento& memento, CancelationOptions options); static bool shouldCancelMotion(const MotionMemento& memento, CancelationOptions options); }; }; /* Manages the dispatch state associated with a single input channel. */ /* Manages the dispatch state associated with a single input channel. */ Loading
include/ui/InputReader.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -402,7 +402,6 @@ private: } mLocked; } mLocked; void initializeLocked(); void initializeLocked(); void initializeLedStateLocked(LockedState::LedState& ledState, int32_t led); void configureParameters(); void configureParameters(); void dumpParameters(String8& dump); void dumpParameters(String8& dump); Loading @@ -414,6 +413,8 @@ private: ssize_t findKeyDownLocked(int32_t scanCode); ssize_t findKeyDownLocked(int32_t scanCode); void resetLedStateLocked(); void initializeLedStateLocked(LockedState::LedState& ledState, int32_t led); void updateLedStateLocked(bool reset); void updateLedStateLocked(bool reset); void updateLedStateForModifierLocked(LockedState::LedState& ledState, int32_t led, void updateLedStateForModifierLocked(LockedState::LedState& ledState, int32_t led, int32_t modifier, bool reset); int32_t modifier, bool reset); Loading
include/ui/InputTransport.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -256,7 +256,7 @@ public: * Returns WOULD_BLOCK if there is no signal present. * Returns WOULD_BLOCK if there is no signal present. * Other errors probably indicate that the channel is broken. * Other errors probably indicate that the channel is broken. */ */ status_t receiveFinishedSignal(bool& outHandled); status_t receiveFinishedSignal(bool* outHandled); private: private: sp<InputChannel> mChannel; sp<InputChannel> mChannel; Loading
include/ui/KeyCharacterMap.h +17 −0 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,12 @@ public: KEYBOARD_TYPE_SPECIAL_FUNCTION = 5, KEYBOARD_TYPE_SPECIAL_FUNCTION = 5, }; }; // Substitute key code and meta state for fallback action. struct FallbackAction { int32_t keyCode; int32_t metaState; }; ~KeyCharacterMap(); ~KeyCharacterMap(); static status_t load(const String8& filename, KeyCharacterMap** outMap); static status_t load(const String8& filename, KeyCharacterMap** outMap); Loading @@ -67,6 +73,13 @@ public: */ */ char16_t getCharacter(int32_t keyCode, int32_t metaState) const; char16_t getCharacter(int32_t keyCode, int32_t metaState) const; /* Gets the fallback action to use by default if the application does not * handle the specified key. * Returns true if an action was available, false if none. */ bool getFallbackAction(int32_t keyCode, int32_t metaState, FallbackAction* outFallbackAction) const; /* Gets the first matching Unicode character that can be generated by the key, /* Gets the first matching Unicode character that can be generated by the key, * preferring the one with the specified meta key modifiers. * preferring the one with the specified meta key modifiers. * Returns 0 if no matching character is generated. * Returns 0 if no matching character is generated. Loading Loading @@ -155,6 +168,10 @@ private: KeyCharacterMap(); KeyCharacterMap(); bool getKey(int32_t keyCode, const Key** outKey) const; bool getKeyBehavior(int32_t keyCode, int32_t metaState, const Key** outKey, const Behavior** outBehavior) const; bool findKey(char16_t ch, int32_t* outKeyCode, int32_t* outMetaState) const; bool findKey(char16_t ch, int32_t* outKeyCode, int32_t* outMetaState) const; static void addKey(Vector<KeyEvent>& outEvents, static void addKey(Vector<KeyEvent>& outEvents, Loading
include/ui/KeycodeLabels.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -211,6 +211,7 @@ static const KeycodeLabel KEYCODES[] = { { "PROG_GREEN", 184 }, { "PROG_GREEN", 184 }, { "PROG_YELLOW", 185 }, { "PROG_YELLOW", 185 }, { "PROG_BLUE", 186 }, { "PROG_BLUE", 186 }, { "APP_SWITCH", 187 }, // NOTE: If you add a new keycode here you must also add it to several other files. // NOTE: If you add a new keycode here you must also add it to several other files. // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list. // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list. Loading