-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[module] Raylib misses mouse clicks #4749
Comments
The core issue seems to stem from the polling nature of raylib's input handling in the game loop. |
It seems like it's the same issue as #4591 but with mouse buttons. The solution is the same and as Jeff said
is also needed for those who want exact events. |
This potential issue could be addressed polling the inputs manually in a second thread. The provided custom_frame_control example could be used as a reference. Note that hardly any user has reported having problems with current mouse input system in +11 years and redesigning the mouse input system to address a very specific sounds as overengineering to me and implies more complexity and more maintenance cost. |
Is it really a specific problem though? I think the code is pretty simple
and I can reproduce this on any Mac here - haven't ttried Windows.
I will try the suggested work-around above... however it takes away from
the simplicity of the API. I think the idea Jeff had was pretty simple and
inline with current design principles of the library.
…On Sun, Feb 2, 2025 at 7:35 AM Ray ***@***.***> wrote:
This potential issue could be addressed polling the inputs manually in a
second thread. The provided custom_frame_control
<https://github.com/raysan5/raylib/blob/master/examples/core/core_custom_frame_control.c>
example could be used as a reference.
Note that hardly any user has reported having problems with current mouse
input system in +11 years and redesigning the mouse input system to address
a very specific sounds as overengineering to me and implies more complexity
and more maintenance cost.
—
Reply to this email directly, view it on GitHub
<#4749 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A5F46A5XJSDLSHKGGLNQNNL2NYGJHAVCNFSM6AAAAABWKCZNO2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRZGM3TQNRRGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi, I implemented the solutiuon above but the mouse events are still missed. This doesn't seem to address the same problem I reported.
|
Please, before submitting a new issue verify and check:
Issue description
While working on a game idea I noticed that mouse clicks don't get registered properly. I wrote a much simplified version of the game loop in Go and in C and observed the same problem.
Basically when you click "swiftly" the code below doesn't always print when the mouse button is pressed. When you hold the button for a bit it does print every time.
Furthermore if you set the frame-rate to 0 (no wait) then it works all the time even with swift presses. I haven't tested if there was actual "rendering load" if it would still work all the time... but in my dumbed down, no-render version it does.
We had a chat with @JeffM2501 in Discord here https://discord.com/channels/426912293134270465/1335478227551912016
The Go library I used packages Raylib-5.5 and I installed Raylib-5.5 through Brew as well for the C version.
Environment
Code Example
Go Version:
C Version
The text was updated successfully, but these errors were encountered: