About Store Forum Documentation Contact



Post Reply 
XBox 360 Controller
Author Message
Kevin Offline
Member

Post: #1
XBox 360 Controller
Hi,
I want support XBox 360 controllers in my game, so I started to create an enum of the XBox controller buttons.
But it seems like there isn't any RT and LT Buttons, at least I didn't found them...

Code:
enum XBOX_BUTTONS {
    XB_A = 0,
    XB_B = 1,
    XB_X = 2,
    XB_Y = 3,
    XB_LB = 4,
    XB_RB = 5,
    XB_BACK = 6,
    XB_START = 7,
    XB_LThumbStick = 8,
    XB_RThumbStick = 9,
}

//Edit:

I can access the left thumbstick direction with Jp[0].dir_a[0], but how do I access the right thumbstick direction?

I just found the private static string array Jp[0].button_name, with all the button names in it, how can I read them and why are they private?
(This post was last modified: 01-08-2010 03:56 PM by Kevin.)
01-08-2010 03:30 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: XBox 360 Controller
Hi,

I've made button_name public, altough they're set manually by the engine,
like "button 0" "button 1", so it won't give you anything special

Quote:but how do I access the right thumbstick direction?
if Jp[0].dir_a[1] doesn't work you may want to check 'directinputsource'

Quote:I want support XBox 360 controllers in my game, so I started to create an enum of the XBox controller buttons.
But it seems like there isn't any RT and LT Buttons, at least I didn't found them...
x360 controller is meant for new api - XInput (not currently used DirectInput), so maybe DI doesn't detect all buttons
adding XInput api support is on my task list, altough I don't have currently an x360 controller, so I can't perform testing this yet
I'll need to buy an x360 controller first
01-08-2010 04:34 PM
Find all posts by this user Quote this message in a reply
Kevin Offline
Member

Post: #3
RE: XBox 360 Controller
Jp[0].dis.rx and Jp[0].dis.ry works well for the the right thumbStick.

Quote:x360 controller is meant for new api - XInput (not currently used DirectInput), so maybe DI doesn't detect all buttons
adding XInput api support is on my task list, altough I don't have currently an x360 controller, so I can't perform testing this yet
I'll need to buy an x360 controller first

Ok thanks, but if you buy a controller buy one with cable. The wireless adapter for PC isn't always working correctly... :-\
01-08-2010 05:46 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: XBox 360 Controller
thanks for the info wink
01-08-2010 06:08 PM
Find all posts by this user Quote this message in a reply
Kevin Offline
Member

Post: #5
RE: XBox 360 Controller
Just noticed, that force feed-back of the xbox 360 controller isn't recoginized either.

And something completly different:
If you use sound.play("path") and the path is wrong you don't get an error, it would be nice to receive an error message (like it shows, when loading an anim with wrong path).
01-08-2010 07:35 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: XBox 360 Controller
Quote:Just noticed, that force feed-back of the xbox 360 controller isn't recoginized either.
yes I know, this also requires XInput API
01-08-2010 09:33 PM
Find all posts by this user Quote this message in a reply
Post Reply