``` Window(onCloseRequest = ::exitApplication, ...
# compose
e
Copy code
Window(onCloseRequest = ::exitApplication,         onKeyEvent = {
        if (it.key == Key.Escape && escEventAllowed){
            escEventAllowed = false
            println("ESC")
                            BackPressureHandler.execute()

            Thread {
                println("escHold")
                Thread.sleep(WAIT_FOR_ESC)
                println("escRelease")
                escEventAllowed = true
            }.start()
        }
        false
    })
I am using the onKeyEvent ability when I create my Window for the desktop main. It is registering escape multiple times instead of just once, and the thread is not helping, any ideas?
i
Press + Release events
e
Any way to see what type of event I got?
i
Copy code
it.type == KeyEventType.KeyDown
e
Thanks for the help, I believe its working 🙂
👍 1