diff options
Diffstat (limited to 'libs/input/Keyboard.cpp')
-rw-r--r-- | libs/input/Keyboard.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/input/Keyboard.cpp b/libs/input/Keyboard.cpp index 07f2289785..11842ee7ff 100644 --- a/libs/input/Keyboard.cpp +++ b/libs/input/Keyboard.cpp @@ -148,9 +148,19 @@ String8 KeyMap::getPath(const InputDeviceIdentifier& deviceIdentifier, // --- Global functions --- +bool isKeyboardSpecialFunction(const PropertyMap* config) { + if (config == nullptr) { + return false; + } + bool isSpecialFunction = false; + config->tryGetProperty(String8("keyboard.specialFunction"), isSpecialFunction); + return isSpecialFunction; +} + bool isEligibleBuiltInKeyboard(const InputDeviceIdentifier& deviceIdentifier, const PropertyMap* deviceConfiguration, const KeyMap* keyMap) { - if (!keyMap->haveKeyCharacterMap() + // TODO: remove the third OR statement (SPECIAL_FUNCTION) in Q + if (!keyMap->haveKeyCharacterMap() || isKeyboardSpecialFunction(deviceConfiguration) || keyMap->keyCharacterMap->getKeyboardType() == KeyCharacterMap::KEYBOARD_TYPE_SPECIAL_FUNCTION) { return false; |