mirror of
https://github.com/glfw/glfw
synced 2026-09-26 16:18:21 +03:00
Merge 0a19ea0a3e into 92dcf4ce74
This commit is contained in:
commit
b39c46a6a9
1 changed files with 4 additions and 0 deletions
|
|
@ -387,6 +387,7 @@ void _glfwTerminateJoysticksLinux(void)
|
|||
GLFWbool _glfwPollJoystickLinux(_GLFWjoystick* js, int mode)
|
||||
{
|
||||
// Read all queued events (non-blocking)
|
||||
GLFWbool event_valid = GLFW_FALSE;
|
||||
for (;;)
|
||||
{
|
||||
struct input_event e;
|
||||
|
|
@ -397,6 +398,8 @@ GLFWbool _glfwPollJoystickLinux(_GLFWjoystick* js, int mode)
|
|||
// Reset the joystick slot if the device was disconnected
|
||||
if (errno == ENODEV)
|
||||
closeJoystick(js);
|
||||
else if ((errno == EAGAIN) && (mode != _GLFW_POLL_PRESENCE))
|
||||
return event_valid;
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -408,6 +411,7 @@ GLFWbool _glfwPollJoystickLinux(_GLFWjoystick* js, int mode)
|
|||
else if (e.code == SYN_REPORT)
|
||||
{
|
||||
_glfw.linjs.dropped = GLFW_FALSE;
|
||||
event_valid = GLFW_TRUE;
|
||||
pollAbsState(js);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue