# Gamepad axis left Y: wrong value?

**URL:** <https://discourse.glfw.org/t/gamepad-axis-left-y-wrong-value/2202>\
**Category:** support\
**Created:** [November 24, 2022, 10:24pm UTC](https://discourse.glfw.org/t/gamepad-axis-left-y-wrong-value/2202 "2022-11-24T22:24:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![petitg1987](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/petitg1987/32/696_2.png) [@petitg1987](https://discourse.glfw.org/u/petitg1987)\
**Post date:** [November 24, 2022, 10:24pm UTC](https://discourse.glfw.org/t/gamepad-axis-left-y-wrong-value/2202/1 "2022-11-24T22:24:22Z")

</div>

I try to retrieve the values of the gamepad axes with:

```auto
GLFWgamepadstate state;
glfwGetGamepadState(GLFW_JOYSTICK_1, &state);
float leftX = state.axes[GLFW_GAMEPAD_AXIS_LEFT_X];
float leftY = state.axes[GLFW_GAMEPAD_AXIS_LEFT_Y];
float rightX = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_X];
float rightY = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_Y];

```

By default all values are 0.0f (error: +/- 0.004f) and goes from -1.0f to 1.0f except for leftY.  
For leftY, the value start at 0.58f (error of 0.08f?) and goes from 0.0f to 1.0f. Is it something expected ? Or is it a possible bug ?

Thank you.

---

<div class="post-metadata">

**Author:** ![petitg1987](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/petitg1987/32/696_2.png) [@petitg1987](https://discourse.glfw.org/u/petitg1987)\
**Post date:** [November 25, 2022, 9:25am UTC](https://discourse.glfw.org/t/gamepad-axis-left-y-wrong-value/2202/2 "2022-11-25T09:25:09Z")

</div>

I tested this morning and now, it works correctly !

Yesterday, my gamepad was identified as “03000000457500000401000011010000,SZMY Power DS4 Wired Controller”  
Today, my gamepad is identified as “030000004c0500006802000011810000,PS3 Controller”

Here is the result of the udevadm command on my Linux:

```auto
greg@greg-desktop:~$ udevadm info -a /dev/input/js0 | grep -E 'id/|name'
    ATTRS{id/bustype}=="0003"
    ATTRS{id/product}=="0268"
    ATTRS{id/vendor}=="054c"
    ATTRS{id/version}=="8111"
    ATTRS{name}=="SZMY-POWER CO.,LTD. PLAYSTATION(R)3 Controller"

```

From what I understand from ‘glfw/linux-joystick.c’, the identification of the wrong controller is directly related to what is returned by /dev/input/js0. So, I guess it is not a bug in GLFW itself.
