diff options
Diffstat (limited to 'include/input/KeyCharacterMap.h')
-rw-r--r-- | include/input/KeyCharacterMap.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/include/input/KeyCharacterMap.h b/include/input/KeyCharacterMap.h index 9423041b68..b2e8baade3 100644 --- a/include/input/KeyCharacterMap.h +++ b/include/input/KeyCharacterMap.h @@ -26,9 +26,9 @@ #include <android-base/result.h> #include <input/Input.h> #include <utils/Errors.h> -#include <utils/KeyedVector.h> #include <utils/Tokenizer.h> #include <utils/Unicode.h> +#include <map> // Maximum number of keys supported by KeyCharacterMaps #define MAX_KEYS 8192 @@ -152,13 +152,9 @@ public: void writeToParcel(Parcel* parcel) const; #endif - bool operator==(const KeyCharacterMap& other) const; + bool operator==(const KeyCharacterMap& other) const = default; - bool operator!=(const KeyCharacterMap& other) const; - - KeyCharacterMap(const KeyCharacterMap& other); - - virtual ~KeyCharacterMap(); + KeyCharacterMap(const KeyCharacterMap& other) = default; private: struct Behavior { @@ -173,17 +169,18 @@ private: /* The replacement keycode if the key has to be replaced outright. */ int32_t replacementKeyCode = 0; + + bool operator==(const Behavior&) const = default; }; struct Key { - Key(); - Key(const Key& other); + bool operator==(const Key&) const = default; /* The single character label printed on the key, or 0 if none. */ - char16_t label; + char16_t label = 0; /* The number or symbol character generated by the key, or 0 if none. */ - char16_t number; + char16_t number = 0; /* The list of key behaviors sorted from most specific to least specific * meta key binding. */ @@ -218,7 +215,6 @@ private: public: Parser(KeyCharacterMap* map, Tokenizer* tokenizer, Format format); - ~Parser(); status_t parse(); private: @@ -232,8 +228,8 @@ private: status_t parseCharacterLiteral(char16_t* outCharacter); }; - KeyedVector<int32_t, Key*> mKeys; - KeyboardType mType; + std::map<int32_t, Key> mKeys; + KeyboardType mType = KeyboardType::UNKNOWN; std::string mLoadFileName; bool mLayoutOverlayApplied = false; |