nwrkbiz / android-xserver

Maintaining the original project to make it work again with new Android versions.
MIT License
167 stars 18 forks source link

Use virtual keyboard as fallback keyboard type #28

Closed utzcoz closed 3 years ago

utzcoz commented 3 years ago

Some devices don't have keyboard with full type, and the Android OS uses the KeyCharacterMap.BUILT_IN_KEYBOARD (value is 0) as the fallback keyboard type. If the phone/tablet doesn't have built in keyboard, the returned KeyCharacterMap is empty, and it will causes the ArrayOutOfBounds exception when initializing keyboard mapping. The problem can be reproduced on the official emulator. So this CL adds KeyboardCharacterMap.VIRTUAL_KEYBOARD as the fallback keyboard type, if the phone/tablet doesn't have FULL keyboard.

utzcoz commented 3 years ago

cc @nwrkbiz

nwrkbiz commented 3 years ago

Thanks, merged