Fix for Amazon Fire TV relative mouse mode - #16349
Open
Packetdancer wants to merge 1 commit into
Open
Packetdancer wants to merge 1 commit into
Packetdancer wants to merge 1 commit into
Conversation
Contributor
Author
|
slouken - If you happen to look at this one over the weekend, hold off on it just yet. This does fix the issue on Amazon Fire TV, but I've now dug up reports of the behavior on Samsung devices too, so I want to dig a bit deeper before we merge. |
Collaborator
|
Okay, holding off... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
For some reason, Amazon Fire TV Stick devices have a weird behavior where, when you put the mouse into relative mode rather than absolute, it also generates keyboard events alongside the mouse. Specifically, the following mappings:
KEYCODE_ENTERKEYCODE_BACKKEYCODE_DPAD_[UP|DOWN|LEFT|RIGHT](repeatedly as you move the mouse)Needless to say, this does some... interesting things. However, conveniently, the Amazon version of Android will generate these from a keyboard with device ID -1, where a real keyboard always has a real device ID. So this change just checks if we're on an Amazon device, and if so, discards keyboard events coming from a
SOURCE_KEYBOARDdevice with ID -1.Existing Issue(s)
In particular, this fixes a weird issue people were seeing where when you started streaming a first-person shooter with Steam Link, the mouse would go into relative mode and now suddenly trying to fire your weapon would also hit enter (opening a chatbox or some other nonsense).
This prevents that. Yay! \o/