Skip to content
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

sdl_event_forwarder always closing after short inactivity #2

Open
gu50 opened this issue Jan 7, 2023 · 0 comments
Open

sdl_event_forwarder always closing after short inactivity #2

gu50 opened this issue Jan 7, 2023 · 0 comments

Comments

@gu50
Copy link

gu50 commented Jan 7, 2023

Key forwarding (used for rp2040-doom) seems to work fine for as long as there's a continous stream of keypresses to send. After a short inactivity, my client always closes.

Poking it with the big stick my almost non-existent programming abilities are, I found the SDL_WaitEvent() becoming false after a short inactivity - so I removed it from the while-loop's condition's AND and put it into the loop:

`old: //while (!done && SDL_WaitEvent(&event)) {

new: while (!done) {
SDL_WaitEvent_return = SDL_WaitEvent(&event);`

At least, this way it now seems to keep working and doesn't close after short inactivity.

There might, of course, be much better (or more correct) ways to solve this issue than this amateurish hack (and maybe it's even caused by something completely unrelated) - but at least it did fix my issue with it :)

This just in case anyone else is seeing a similar issue (or has a better way of fixing this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant