raylib icon indicating copy to clipboard operation
raylib copied to clipboard

[rcore][rgfw] No key release on focus loss

Open M374LX opened this issue 9 months ago • 4 comments

With the RGFW backend, when the window loses focus while a key is still being held, the program behaves as if the key were still being held, even if it is actually released after the focus loss.

The issue is not present in the GLFW and SDL backends.

M374LX avatar May 31 '25 17:05 M374LX

@M374LX could you send a PR to address this issue?

raysan5 avatar Jun 03 '25 08:06 raysan5

@ColleagueRiley Apparently, GLFW and SDL automatically generate a key release event for each key being held when the window loses focus, which RGFW does not. Do you think RGFW should do the same?

https://github.com/glfw/glfw/blob/e7ea71be039836da3a98cea55ae5569cb5eb885c/src/window.c#L43

M374LX avatar Jun 03 '25 21:06 M374LX

Although the solution seems sketchy, I think it's worth implementing. Sadly I don't think there is a better solution.

This issue should probably be moved over to the RGFW repo.

ColleagueRiley avatar Jun 04 '25 04:06 ColleagueRiley

Here it is: https://github.com/ColleagueRiley/RGFW/issues/171.

M374LX avatar Jun 04 '25 13:06 M374LX