mirror of
https://github.com/glfw/glfw.git
synced 2025-12-21 14:42:06 +00:00
Compare commits
3 Commits
c7e5a31ab9
...
399a8e9b1d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
399a8e9b1d | ||
|
|
0d2d85d19c | ||
|
|
ee38126be5 |
@ -1261,11 +1261,8 @@ GLFWAPI void* glfwGetJoystickUserPointer(int jid)
|
|||||||
GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun)
|
GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun)
|
||||||
{
|
{
|
||||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||||
|
|
||||||
if (!initJoysticks())
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
_GLFW_SWAP(GLFWjoystickfun, _glfw.callbacks.joystick, cbfun);
|
_GLFW_SWAP(GLFWjoystickfun, _glfw.callbacks.joystick, cbfun);
|
||||||
|
initJoysticks();
|
||||||
return cbfun;
|
return cbfun;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1778,24 +1778,6 @@ static void keyboardHandleLeave(void* userData,
|
|||||||
if (!window)
|
if (!window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Handle any key repeats up to this point. We don't poll as this should be infrequent.
|
|
||||||
uint64_t repeats;
|
|
||||||
if (read(_glfw.wl.keyRepeatTimerfd, &repeats, sizeof(repeats)) == 8)
|
|
||||||
{
|
|
||||||
if(_glfw.wl.keyboardFocus)
|
|
||||||
{
|
|
||||||
for (uint64_t i = 0; i < repeats; i++)
|
|
||||||
{
|
|
||||||
_glfwInputKey(_glfw.wl.keyboardFocus,
|
|
||||||
translateKey(_glfw.wl.keyRepeatScancode),
|
|
||||||
_glfw.wl.keyRepeatScancode,
|
|
||||||
GLFW_PRESS,
|
|
||||||
_glfw.wl.xkb.modifiers);
|
|
||||||
inputText(_glfw.wl.keyboardFocus, _glfw.wl.keyRepeatScancode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct itimerspec timer = {0};
|
struct itimerspec timer = {0};
|
||||||
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
timerfd_settime(_glfw.wl.keyRepeatTimerfd, 0, &timer, NULL);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user