I could be misreading the docs, but I haven't found a built in way to keep track of what keys are being held, so currently I'm pushing and popping from a held vector something like this:
This works fine for the listen callback, but using the unstable grab feature I can't mutate since grab does not take an fnMut. Just wondering how others have handled keeping track of held keys, since it seems like a pretty common use case for this crate! Cheers!
For anyone who stumbles across this, I found that the best way was to use an ArcMutex storing whatever way you want to represent the held keys for me Vec and unlock within the callback to grab.
I could be misreading the docs, but I haven't found a built in way to keep track of what keys are being held, so currently I'm pushing and popping from a held vector something like this:
This works fine for the listen callback, but using the unstable grab feature I can't mutate since grab does not take an fnMut. Just wondering how others have handled keeping track of held keys, since it seems like a pretty common use case for this crate! Cheers!