scenery icon indicating copy to clipboard operation
scenery copied to clipboard

VR releasing one side button when both are pressed unpresses both

Open moreApi opened this issue 3 years ago • 7 comments

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.

moreApi avatar Jun 23 '21 11:06 moreApi

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

skalarproduktraum avatar Dec 16 '21 14:12 skalarproduktraum

Same behavior for button Side,Trigger and A and probably all others

moreApi avatar May 17 '22 15:05 moreApi

Okay, so this is probably not an oversight, but an actual semantic error -.-

skalarproduktraum avatar May 18 '22 09:05 skalarproduktraum

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.

moreApi avatar Jun 20 '23 13:06 moreApi

Input handling is one of the darkest kinds of magic.

skalarproduktraum avatar Jun 20 '23 19:06 skalarproduktraum

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?

skalarproduktraum avatar Jun 20 '23 19:06 skalarproduktraum

I dont think we need to care about the proximity sensor 👍

moreApi avatar Jun 26 '23 12:06 moreApi