diff options
Diffstat (limited to 'include/ui/KeyCharacterMap.h')
-rw-r--r-- | include/ui/KeyCharacterMap.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/ui/KeyCharacterMap.h b/include/ui/KeyCharacterMap.h index a1ccb37..10a3810 100644 --- a/include/ui/KeyCharacterMap.h +++ b/include/ui/KeyCharacterMap.h @@ -44,6 +44,12 @@ public: KEYBOARD_TYPE_SPECIAL_FUNCTION = 5, }; + // Substitute key code and meta state for fallback action. + struct FallbackAction { + int32_t keyCode; + int32_t metaState; + }; + ~KeyCharacterMap(); static status_t load(const String8& filename, KeyCharacterMap** outMap); @@ -67,6 +73,13 @@ public: */ 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, * preferring the one with the specified meta key modifiers. * Returns 0 if no matching character is generated. @@ -155,6 +168,10 @@ private: 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; static void addKey(Vector<KeyEvent>& outEvents, |