# \[Python:\] Best way to detect moved joystick axis

**URL:** <https://blenderartists.org/t/python-best-way-to-detect-moved-joystick-axis/559865>\
**Category:** Game Engine Support and Discussion\
**Created:** [December 18, 2012, 2:28pm UTC](https://blenderartists.org/t/python-best-way-to-detect-moved-joystick-axis/559865 "2012-12-18T14:28:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdfgeoff](https://blenderartists.org/user_avatar/blenderartists.org/sdfgeoff/32/15010_2.png) [@sdfgeoff](https://blenderartists.org/u/sdfgeoff)\
**Post date:** [December 18, 2012, 2:28pm UTC](https://blenderartists.org/t/python-best-way-to-detect-moved-joystick-axis/559865/1 "2012-12-18T14:28:49Z")

</div>

I’m making… a joystick axis-mapper.

I’ve got the button mapping and sensitivity settings already mapping fine, but need some advice on how to find a moving axis (assuming there is one).

The way I was thinking of doing it was:

```auto
x = 0
while x &gt; numAxis:
    axisPos = JoystickSensor.axisValues[x]
    if abs(axisPos) &gt; 512:
        '''then map this axis, using the value x to tell me which axis it is that's moving'''
    x+=1

```

Does this sound like a feasible way to do it?  
Is there a better way?

–EDIT–  
Meh, i just did it this way, and it works fine. I see no reason to change it now.
