The way the current code worked was by calling `GetCurrentMonitor()`,
which would always return the monitor at position (0,0). This isn't the
primary monitor on all platforms, on Linux in particular it isn't the
case.
This isn't the case on the SDL backend, after calling `InitWindow()` the
window would always show up on the primary monitor. Even on the GLFW
backend, if the full screen flag was set it would attempt to put it on
the primary monitor as it would call `glfwGetPrimaryMonitor()` to do it,
so for consistency's sake we should do it on windowed mode too.
The key handling in PLATFORM_DESKTOP_SDL was faulty in two ways, which
led to GetKeyPressed returning incorrect data.
CORE.Input.Keyboard.keyPressedQueue was updated only on SDL_TEXTINPUT,
meaning only text characters were registered as a pressed key, but not
function keys (eg. tab, backspace...). Also on such event, both
CORE.Input.Keyboard.keyPressedQueue and
CORE.Input.Keyboard.charPressedQueue were assigned the key's
corresponding codepoint, when CORE.Input.Keyboard.keyPressedQueue
should get the raylib keycode instead.
CORE.Input.Keyboard.keyPressedQueue is now updated on SDL_KEYDOWN event
instead.
Co-authored-by: Arthur <hi@thenightwat.ch>
The changes brought by #3891 uses `std.process.Child.run` which was
renamed from `std.process.Child.exec` in Zig version 0.11.0. This commit
adds a version check to use the appropriate function names.
Additionally, the `linux_display_backend` configuration option is added
so users can set it when running `zig build` with the `-D` option or
when using raylib as a dependency.
* Updating rcore_drm.c to only use one api for input
* Change RPI log prefix to DRM
* Remove relative checking which is not supported currently
* Loop should continue on invalid event in drm backend
* Fixed and cleaned up PollKeyboardEvents() in drm backend
* Fix GLFW runtime platform detection
* Add libwayland-dev package to workflows
* Add libxkbcommon-dev package to workflows
* Add libwayland-bin package to codeql.yml
* Add libwayland-client0 and libwayland-cursor0 packages to codeql.yml
* Use libwayland-dev in codeql.yml
* Add libxkbcommon-dev to codeql.yml
* Remove libwayland-bin from linux.yml and linux_examples.yml (libwayland-dev includes it as a dependency)
---------
Co-authored-by: Ray <raysan5@gmail.com>
I did some testing and this seems to work okay, but it *is* different to
GLFW. GLFW seems to lose "IsCursorOnScreen" for one frame upon pressing
alt+tab over the window, without a different window covering it. SDL
seems to have a more reasonable behavior for this case. Either way it's
an edge case and I don't know the exact way to fix, likely requires
internal GLFW changes.