Controller axis values - can these be accessed outside of the axis event?

The Green Throttle controller can return values every frame by calling:

greenthrottle.getAnalogState(greenthrottle.ANALOG\_AXIS\_X, greenthrottle.CONTROLLER\_1, greenthrottle.ANALOG\_LEFT), 

in the enterFrame function.

Is something like this possible using the HID controls? I want to track how much the user is moving the sticks, and so want to get values for the sticks even when they are not moving (i.e. movement speed = 0).

Given that I already know the descriptors for each stick, is it possible to retrieve the current axis values for each of them?

Check out this forum post for a bit of additional info:

http://forums.coronalabs.com/topic/38905-360-degree-joystick-movement/#entry201944

The stick events only fire when the stick moves.  If you’re holding it in a fixed position, you’re not getting more events.  So I would just save the last event values into a variable that could be accessed outside of the event handler.

I find that the problem with this is when the user releases the stick. I’ve found that if the stick snaps back too quickly, the event doesn’t always trigger properly (or rather it doesn’t fire continuously so it doesn’t record any slight movements made between frames).

It’s quite easy to have a character that continues to move once the stick is released, because the last time the event fired the analog stick was not quite at 0, 0. I could do something like:

if lastValue \< 0.1 then lastValue = 0 end

but that makes it difficult to allow slower movements, and I’ve no guarantee that the last recorded result won’t be 0.11 or higher.

I’m using a 15% value (0.15) myself.

Check out this forum post for a bit of additional info:

http://forums.coronalabs.com/topic/38905-360-degree-joystick-movement/#entry201944

The stick events only fire when the stick moves.  If you’re holding it in a fixed position, you’re not getting more events.  So I would just save the last event values into a variable that could be accessed outside of the event handler.

I find that the problem with this is when the user releases the stick. I’ve found that if the stick snaps back too quickly, the event doesn’t always trigger properly (or rather it doesn’t fire continuously so it doesn’t record any slight movements made between frames).

It’s quite easy to have a character that continues to move once the stick is released, because the last time the event fired the analog stick was not quite at 0, 0. I could do something like:

if lastValue \< 0.1 then lastValue = 0 end

but that makes it difficult to allow slower movements, and I’ve no guarantee that the last recorded result won’t be 0.11 or higher.

I’m using a 15% value (0.15) myself.