orx icon indicating copy to clipboard operation
orx copied to clipboard

[orx-gui] Collapsed GUI intercepts and handles some mouse and keyboard events

Open Yvee1 opened this issue 2 years ago • 0 comments

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

  1. 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) }
    }
}
  1. Collapse the GUI and scroll with the scrollwheel in the area of the GUI.
  2. Open the GUI and notice that it has scrolled. The console is filled with "true" indicating that the scroll event was handled.
  3. Click on "Button" under "No name".
  4. Close the GUI, and press the spacebar. Note that "Clicked" and "true" is printed in the console.

Yvee1 avatar Mar 19 '23 09:03 Yvee1