Nazariglez / notan

Cross-platform multimedia layer
https://nazariglez.github.io/notan-web/
Apache License 2.0
802 stars 55 forks source link

Is it possible to get (keyboard) events when the window is not focused? #235

Closed xanderjakeq closed 1 year ago

xanderjakeq commented 1 year ago

The default input events seem to only be detected when the window is focused. I want to listen to keyboard/mouse events even the window in unfocused. Is it possible to do that?

I saw this device_query crate, it can listen to keyboard events without needing a window. Is it possible to integrate this with notan?

xanderjakeq commented 1 year ago

device_state.get_keys() from device_query can be used within the update function of notan.

Nazariglez commented 1 year ago

Hello @xanderjakeq, thanks reaching out, if getting the keys on the update method works for you that's great! Another option could be create a custom plugin, but it will need more boilerplate.