dMZX Forums: Some joystick / gamepad notes - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Some joystick / gamepad notes at least pertaining to Linux

#1 User is offline   iamgreaser 

  • cats.py
  • PipPip
  • Group: Members
  • Posts: 141
  • Joined: 24-March 08
  • Gender:Male
  • Location:Not Australia

Post icon  Posted 07 June 2011 - 11:40 PM

After screwing around with joysticks, I think I've got some stuff sussed.

If you're wondering why semi-centering the Y axis blanks out the positive X axis button, it's because -1 is used as centre, and 0 and 1 are used as positive / negative, and event_sdl.c doesn't stop the code from cancelling out the button at [axis][-1], which is at least in some cases equivalent to [axis-1][1]. I have a sane patch in the bug tracker, which is applicable to 2.83, and should hopefully fix that bug in 2.83b which also remains from the last snapshot I checked.

At least on Linux, the Playstation 3 controller is reported as having 19 buttons and 27/28 axes - evdev reports 27, while the classic joystick API reports 28 (touch-sensitive buttons FTW). This is a fair whack more than 16. Perhaps raising the limit to at least 64 axes / buttons (AND ADD A CLAMP() FOR THE BUTTONS DAMMIT) might help as gamepads get sillier?

Speaking of evdev/joystick, at least in Linux 2.6.33 / SDL 1.2.14, SDL + evdev = missed buttons / axis motions at least with our PS3 controller. You want to make sure SDL_INPUT_LINUXEV is turned off (include/sdl_config.h) so that it uses the classic joystick API instead. Someone might want to look further into this... either that or I could just upgrade my kernel :P

Speaking of touch-sensitive buttons, would allowing an optional third, "centre" key mapping for each axis setting be worth considering? As it stands, most buttons are comfortably pressed when in the positive range (-32768 == far negative == OFF), but the D-pad is more comfortably pressed in the centred range.
blah blah raycasters blah blah blah

<Stephen> are you dozing
<gm|lap> totally
<Stephen> good
<Stephen> i will bury you
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users