Jump to content


Photo

Sdl Controller Layout?


  • Please log in to reply
4 replies to this topic

#1 VampX

VampX

    X-S Legend

  • Moderator
  • PipPipPipPipPipPipPipPipPip
  • 5,149 posts
  • Xbox Version:v1.2
  • 360 version:none

Posted 26 April 2010 - 05:05 AM

Okay I have no idea if i'm asking the right thing here, but a friend of mine
needs to know the xbox controller layout for SDL based stuff.

Also he still needs the gamecube layout, so if anyone has those he'd be grateful
if you could also write those down too.


Here's hoping!

#2 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 595 posts
  • Gender:Male
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v5.0 (360S - trinity)

Posted 26 April 2010 - 05:31 AM

Call SDL_OpenJoystick() and then poll it... push the buttons and you will get the mapping. It is a very simple sample app to throw together and you could even find one easily on the net.

Left stick left/right = axis0
Left stick up/down = axis1
Right stick left/right = axis2
Right stick up/down = axis3

D-Pad = Hat0 (It has 8 possible positions but it is one device)

The rest including the triggers and pushing down on the analog stick are buttons. I could fire up Odamex and easily give you the mapping but not tonight. The sdl_joystick code for Xbox is on my repository here: http://svn.huntsvega...L_sysjoystick.c

I don't know about the GC button mapping but the Wii mapping is right here: http://www.wiibrew.o...oystick_mapping

#3 VampX

VampX

    X-S Legend

  • Moderator
  • PipPipPipPipPipPipPipPipPip
  • 5,149 posts
  • Xbox Version:v1.2
  • 360 version:none

Posted 26 April 2010 - 05:41 AM

QUOTE(Hyper_Eye @ Apr 26 2010, 06:31 AM) View Post

I could fire up Odamex and easily give you the mapping but not tonight.


That would be greatly appreciated!

#4 Hyper_Eye

Hyper_Eye

    X-S Expert

  • Members
  • PipPipPip
  • 595 posts
  • Gender:Male
  • Location:Huntsvegas, AL.
  • Xbox Version:v1.0
  • 360 version:v5.0 (360S - trinity)

Posted 26 April 2010 - 06:52 PM

I fired up Odamex and went through the buttons in the binds menu. In SDL id's start at 0 so the following mapping is 1 less than what shows in Odamex since I start at 1 in Odamex.

CODE
Analog Axes:
Left Stick X Axis   = 0
Left Stick Y Axis   = 1
Right Stick X Axis  = 2
Right Stick Y Axis  = 3

Hats:
D-Pad               = 0

Buttons:
A                   = 0
B                   = 1
X                   = 2
Y                   = 3
Black               = 4
White               = 5
Left Trigger        = 6
Right Trigger       = 7
Start               = 8
Back                = 9
Left Stick Down     = 10
Right Stick Down    = 11


#5 VampX

VampX

    X-S Legend

  • Moderator
  • PipPipPipPipPipPipPipPipPip
  • 5,149 posts
  • Xbox Version:v1.2
  • 360 version:none

Posted 26 April 2010 - 07:13 PM

Thank you very much kind sir! thats exactly what he needed.

he also found the Gamecube layout so he's got all he needed.

Thanks a lot! IPB Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users