orx
orx copied to clipboard
[orx-gui] Collapsed GUI intercepts and handles some mouse and keyboard events
Operating System
Windows
OPENRNDR version
latest from Github at the time of writing
ORX version
latest from Github at the time of writing
Java version (if applicable)
No response
Describe the bug
A GUI that is collapsed still intercepts and handles some mouse and keyboard events. In particular, I noticed this for the following events:
- Scrolling in the area of a collapsed GUI;
- Pressing the spacebar when a button is focused.
Steps to reproduce the bug
- Run the following program.
fun main() = application {
program {
val s = object {
@ActionParameter("Button")
fun f() { println("Clicked") }
}
val gui = GUI()
gui.add(s)
extend(gui)
mouse.scrolled.listen { println(it.propagationCancelled) }
keyboard.keyDown.listen { println(it.propagationCancelled) }
}
}
- Collapse the GUI and scroll with the scrollwheel in the area of the GUI.
- Open the GUI and notice that it has scrolled. The console is filled with "true" indicating that the scroll event was handled.
- Click on "Button" under "No name".
- Close the GUI, and press the spacebar. Note that "Clicked" and "true" is printed in the console.