Skip to content

Commit 97ee0c5

Browse files
Packetdancerslouken
authored andcommitted
Fix for Amazon Fire TV relative mouse mode (#16349)
(cherry picked from commit 00b1f0f9dcbfdf7c4f6a61f87550a53425a1c8a4)
1 parent fc6a7f4 commit 97ee0c5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎android-project/app/src/main/java/org/libsdl/app/SDLActivity.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,13 @@ public static boolean handleKeyEvent(View v, int keyCode, KeyEvent event, InputC
14681468
int deviceId = event.getDeviceId();
14691469
int source = event.getSource();
14701470

1471+
if ((event.getFlags() & KeyEvent.FLAG_FALLBACK) != 0) {
1472+
// If this is a fallback event -- e.g., the mouse is being turned into dpad navigational keys
1473+
// just eat it, since that's almost never what we actually want to have happen. This will
1474+
// happen with Logitech mice on Amazon Fire TV devices and some Samsung devices.
1475+
return true;
1476+
}
1477+
14711478
if (source == InputDevice.SOURCE_UNKNOWN) {
14721479
InputDevice device = InputDevice.getDevice(deviceId);
14731480
if (device != null) {

0 commit comments

Comments
 (0)