Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - user1234

Pages: [1]
1
General / Problem with Y-Axis on gamepad
« on: July 25, 2014, 07:25:00 am »
Hi, I have a Logitech gamepad. My application recognizes there's a controller of id 0. When I start my Pong game, the left pad moves upward for some odd reason. However, I'm not pressing up on the gamepad's Y axis when this happens.

While debugging, I get this value for joy.y_pos = "-0.0015259022". This is without pressing anything on the gamepad. I would expect the value to be 0. My gamepad works for other games, so I'm not sure why this is causing different behavior.

Moving the pad up/down on the Y-axis has no effect, as the pad just keeps wanting to move upward. The controller was calibrated.

I'm using SFML 2.1 on Win32(Windows 7). Controller: Logitech 940-000110 Gamepad F310. Are there any known reasons to this problem? Thanks.

Code: [Select]
joy.y_pos = sfJoystick_getAxisPosition(JOYSTICK_ID_0, sfJoystickY);
if (joy.y_pos < 0) {
joy.blnDown = FALSE;
joy.blnUp = TRUE;
}
else if (joy.y_pos  > 0) {
joy.blnDown = TRUE;
joy.blnUp = FALSE;
}


Pages: [1]
anything