SFML community forums

Help => Window => Topic started by: DrifterRLDev on March 06, 2025, 05:24:26 pm

Title: KeyReleased event missed when going from fullscreen to windowed
Post by: DrifterRLDev on March 06, 2025, 05:24:26 pm
Hi, I think this could be a bug, but please let me know if I'm just misguided  :)

I'm noticing that when I go from fullscreen to windowed, the key that I use to trigger the fullscreen toggle does not fire a KeyReleased event.

Repro should be simple enough: just set a key to toggle fullscreen on/off and breakpoint on the KeyReleased event.
Title: Re: KeyReleased event missed when going from fullscreen to windowed
Post by: eXpl0it3r on March 06, 2025, 06:54:16 pm
This likely caused, because switching mode is done through recreation of the window, so you'll end up with a new window handle and the event will likely be sent to the old one. I guess you could try and hold the key until the new window is ready an see if it then triggers correctly.

If you're tracking key states, you may want to reset the states once you recreate the window, since you might have also missed other events.

I don't know the specific APIs (yet), but the plan is, if the API allows it, to allow switching between windowed and fullscreen without recreating the window.
Title: Re: KeyReleased event missed when going from fullscreen to windowed
Post by: DrifterRLDev on March 06, 2025, 08:46:18 pm
Thanks for the quick response. I am tracking key states, so I'll just clear my input buffer after going fullscreen - thanks for the suggestion.