mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 19:21:38 +02:00
Merge branch 'glfw_upstream' of https://github.com/Luflosi/kitty
This commit is contained in:
14
glfw/input.c
vendored
14
glfw/input.c
vendored
@@ -1436,8 +1436,18 @@ GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state)
|
|||||||
if (e->type == _GLFW_JOYSTICK_AXIS)
|
if (e->type == _GLFW_JOYSTICK_AXIS)
|
||||||
{
|
{
|
||||||
const float value = js->axes[e->index] * e->axisScale + e->axisOffset;
|
const float value = js->axes[e->index] * e->axisScale + e->axisOffset;
|
||||||
if (value > 0.f)
|
// HACK: This should be baked into the value transform
|
||||||
state->buttons[i] = GLFW_PRESS;
|
// TODO: Bake into transform when implementing output modifiers
|
||||||
|
if (e->axisOffset < 0 || (e->axisOffset == 0 && e->axisScale > 0))
|
||||||
|
{
|
||||||
|
if (value >= 0.f)
|
||||||
|
state->buttons[i] = GLFW_PRESS;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (value <= 0.f)
|
||||||
|
state->buttons[i] = GLFW_PRESS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (e->type == _GLFW_JOYSTICK_HATBIT)
|
else if (e->type == _GLFW_JOYSTICK_HATBIT)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user