[java] allow setting a different keyboard or pointer for actions on i… #10213
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.
You can see how difficult it is to work with an input device that isn't a default keyboard or a default mouse in the tests I wrote for a pointer.
Using a
setActivePointer()
/setActiveKeyboard
is one way of making this easier. I was looking at different options like putting it in the constructor, but then you'd need 8 different constructors when we add in wheel support soon.The Actions class does a good job of adding Pauses where needed for newly seen inputs already, but something does not like 2 different objects being given the same name, so we need to re-use the existing input object if it is there rather than creating a new one.
The implementation can probably be improved.