Use higher values as a fallback for unknown keycodes on android

This commit is contained in:
Deve 2018-08-21 21:36:39 +02:00
parent ba6bbd4133
commit 54c9fb97fa

View File

@ -717,7 +717,7 @@ s32 CIrrDeviceAndroid::handleKeyboard(AInputEvent* androidEvent)
// scan code, because it's better than nothing
if (event.KeyInput.Key == 0)
{
event.KeyInput.Key = (EKEY_CODE)scanCode;
event.KeyInput.Key = (EKEY_CODE)((int)IRR_KEY_CODES_COUNT + scanCode);
}
// Handle an event when back button in pressed just like an escape key
@ -868,7 +868,7 @@ s32 CIrrDeviceAndroid::handleGamepad(AInputEvent* androidEvent)
if (event.KeyInput.Key == 0)
{
event.KeyInput.Key = (EKEY_CODE)scanCode;
event.KeyInput.Key = (EKEY_CODE)((int)IRR_KEY_CODES_COUNT + scanCode);
}
postEventFromUser(event);