Help - Search - Members - Calendar
Full Version: Sdl Controller Layout?
Scenyx Entertainment Community > Xbox1 Forums > Software Forums > Homebrew & Ported Games
VampX
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!
Hyper_Eye
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.huntsvegas.org/wsvn/SDLx/trunk/...L_sysjoystick.c

I don't know about the GC button mapping but the Wii mapping is right here: http://www.wiibrew.org/wiki/Sdl#SDL_joystick_mapping
VampX
QUOTE(Hyper_Eye @ Apr 26 2010, 06:31 AM) *

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


That would be greatly appreciated!
Hyper_Eye
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
VampX
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.