I’m developing an app which has a single window on Desktop. I’m trying to detect focus change events for that particular window. For example when I hover my mouse away from it, or the window loses focus.
I’ve tried using onFocusEvent
and onFocusChanged
but they only get invoked when I set the Window
visible parameter to true
fun main() {
application {
window () {
Column (
modifier = Modifier
.onFocusEvent {
// Only gets invoked when the window becomes visible
}
.onFocusChanged {
// Same goes here as well
}
) {
}
}
}
}