-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No keypresses detected (seemingly random) #626
Comments
Alright, thanks for the report! Do you have any system-order ambiguities? The random nature of this makes me suspicious about it. The example or our test in CI should be helpful to explain how to do this. The output isn't great, especially for screen readers, so if you put up a reproduction repo I can take a look myself. I would also be curious to see if this reproduces without the screen-reader and/or without LWIM: please let me know if you need a hand. |
Thanks for getting back to me. |
Alright, thanks! I'll ask if anyone has the time to reproduce and investigate. |
Hey, blind screen reader using Bevy developer here, I'll try to help you out. I think there may be 2 issues here--the first being the UI/accessibility focus, which I've experienced but haven't dug much into and don't think is specific to LWIM. One thing you almost certainly have to do and can't automate is putting NVDA into sleep mode so it ignores all keystrokes sent to the app. In laptop layout this is done via NVDA-Shift-Z--not sure what the desktop layout command is. Does the issue go away if you focus the window and use sleep mode? My production game struggles a bit and doesn't launch deterministically, but if I focus the window and ensure sleep mode is on, I haven't had input issues (well, not this blatant at least.) But sometimes the window gets accessibility focus, others it doesn't, and when that happens I have to do the focus/sleep-mode dance to have input reliably intercepted. Hoping to find cycles to look into the weird accessibility focus issues during this release, and hopefully fixing that will make these problems with input go away too. |
Hi there, thanks for taking a look. |
Version
0.15.0
Operating system & version
Windows 11 (latest)
What you did
I'm currently starting to write a game in Bevy and am planning to use leafwing-input-manager for keyboard/gamepad/etc input. So far everything has worked fine, but sometimes when starting the game, no keystrokes get picked up. When closing the program down and starting it up again, it sometimes works, sometimes doesn't.
I do set up the ActionState conditionally though and don't leave it within the ECS all the time. I don't know if that is part of the issue or not. My code follows.
Cargo.toml looks like this:
What you expected to happen
Launching the app will switch into GameState::Menu and keystrokes get properly picked up by Bevy/leafwing-input-manager.
What actually happened
Sometimes it works and the println statements get printed properly, some other times it doesn't do anything. Further debugging shows that my actions get properly registered (all_actions_data() returns them properly), but the actual events don't show up in keys() or get_pressed().
Additional information
I don't get any log messages or anything when this happens. One thing that might be important is that i'm using a screen reader, namely NVDA. This screen reader doesn't intercept keys, it isn't responsible for the keys never arriving at the app, but I can see that sometimes when doing a cargo run on the cmd, the bevy window will instantly get focused, some other times it will open in the background and focus will stay within the console log window. To me it feels like this issue occurs more often when the console window stays focused other than the moments where the window receives focus automatically, but that is just a feeling, I don't have any proof.
Let me know if I can help further debug this issue.
Thanks!
The text was updated successfully, but these errors were encountered: