x360 support/config

Blitz3D Forums/Blitz3D Programming/x360 support/config

mtnhome3d(Posted 2008) [#1]
ok i'm writing a config prog for my new controllers and i have a problem. the d-pad registers as a hat and i'm using joyhat() to return a number to draw a line with but it wont return the number.
heres the code

and you will need to save both the code and this picture properly if you want to see the cool graphics the way there supposed to be. you need to save it as a bmp named controller.bmp



mtnhome3d(Posted 2008) [#2]
anyone?


Dreamora(Posted 2008) [#3]
The XBox 360 pad only runs with XInput, not fully DirectInput ... you sadly decided for the wrong pad to work with DX7 - DX9c 07 (the same as owners of other pads have problems with XInput oriented games in most cases)


Mark Tiffany(Posted 2008) [#4]
Is this the same problem as Mr John Pickford is experiencing?

http://www.blitzmax.com/Community/posts.php?topic=77723


Warner(Posted 2008) [#5]
Is this post related ?
http://www.blitzbasic.com/Community/posts.php?topic=71496
http://www.blitzbasic.com/Community/posts.php?topic=69681


mtnhome3d(Posted 2008) [#6]
ok, d-pad isn't totally nesecary but i have ran the joyhat() example and it returns a degree e.g. 180,90,45 so i don't know why my line command isn't working.


skidracer(Posted 2008) [#7]
try case jhat=0 -> case 0


IPete2(Posted 2008) [#8]
Not wishing to rain on anyones parade...

May I recommend getting the Joytech rumblepad 2 - and use Pepsi's dll and library - you won't go far wrong and I think rumble is supported too?

It has a complete library of commands which works beautifully.

IPete2.


Pongo(Posted 2008) [#9]
Just to correct some mis-information,...the 360 pad is awesome, I've had no issues with it. The only thing you don't have access to in DX7 is the rumble features.

The hat on mine is returning -1 in the neutral position, and 0,45,90,... around the different positions.

your current code only checks if joyhat = 0 (up)

edit: removed sample joyhat() code,... see example in next post below.


Also, you may want to consider doing a setup similar to this:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1592

That only uses the analog sticks and triggers, but this method allows you to map *any* controller for your game, instead of having to hard code each controller. It would not be too hard to expand the buttons and hat into this as well.


Pongo(Posted 2008) [#10]
your line command is not working because your code doesn't have any thing to do.

currently you are only checking if jhat=0 which would be the up position. none of the other angles are being checked for.

edit: here is a code sample that does what you need.