Hello, I have a question concerning Compose Desktop. Is it possible to receive global keyboard events for a whole window (like for a simple game)? I found no way to actually receive the events, neither with
.onKeyEvent
, nor with
.shortcuts
. Thank you very much
k
Kari Kähkönen
05/24/2021, 10:02 AM
I'd be interested in this as well. I have the whole screen wrapped in a Box which has onKeyEvent modifier. It doesn't receive events until I press arrow keys, then it starts working. And if I click with mouse somewhere on the screen, the key events stop until I press some arrow key again. I'm not sure why.
👍 2
c
Christian Babsek
05/24/2021, 10:23 AM
I probably found a solution, it seems to be possible to somehow get the local window, the following code solved my problem for now: