scenery
scenery copied to clipboard
VR releasing one side button when both are pressed unpresses both
Reproduce:
- checkout https://github.com/scenerygraphics/scenery/tree/vr-ui-tools
- start VRControllerExample
- (select a box with left side button)
- press and hold both side buttons to start scaling
- release one, keep the other one pressed
- press and hold both again
- -> scaling does not work
The log messages show that with the first release both buttons are released.
The place this probably goes wrong should be https://github.com/scenerygraphics/scenery/blob/999a4b381f32f27ba6b8a99cba1caffef4f1f948/src/main/kotlin/graphics/scenery/controls/OpenVRHMD.kt#L547-L589
Same behavior for button Side,Trigger and A and probably all others
Okay, so this is probably not an oversight, but an actual semantic error -.-
line 566 of the excerpt above is the cause of pressed keys being empty.
But withouyt that line no VR button works anymore.
At least for drag behaviors that is because https://github.com/scijava/ui-behaviour/blob/9cbc0df842c240e36af48b48fc294ea8c982a63d/src/main/java/org/scijava/ui/behaviour/MouseAndKeyHandler.java#L440 only does exact matching and since there is always this axis or proximity thing pressed it always returns false.
There is something about "irgnored keys" in that match function. But this whole thing looks like highe magic to me.
Input handling is one of the darkest kinds of magic.
Jokes aside - I'd argue here it'd likely be best to allow only the actual buttons to trigger events, and and ignore the proximity sensor. What do you think, @moreApi?
I dont think we need to care about the proximity sensor 👍