Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Xbox 360 Controller: D-Pad and Vibration  (Read 10870 times)
0 Members and 1 Guest are viewing this topic.
Offline aoen

Junior Newbie





« Posted 2009-12-09 07:21:07 »

I got jinput working with my xbox360 controller and I am really impressed so far (aside from the lack of API and any commenting lol), but I have two questions:

How do I access the D-Pad values, and is it possible to vibrate the controller (if not through jinput then by some other means, as long as it's not too complicated).
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #1 - Posted 2009-12-09 07:26:40 »

There are other posts on this forum asking similar questions.

There are some features that are only exposed using xinput, yet another input API from microsoft to add to the (at least) 2 they already had. As I only know of the 360 controller using it, it's not something that has had much attention.

Feel free to write the plugin for JInput to get those last 2 bits on the controller working Smiley

Endolf

Offline aoen

Junior Newbie





« Reply #2 - Posted 2009-12-09 07:34:42 »

Ah sorry I searched for "D-Pad" and "Vibrate" and came up with nothing relevant.

Aw man that sucks, gah maybe I should just switch over to C# & XNA.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

« JGO Spiffy Duke »


Medals: 195
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2009-12-09 09:03:38 »

Quote
Aw man that sucks, gah maybe I should just switch over to C# & XNA.

Oh noes! He's gonna switch! Quick Endolf, code it up!

Kev

Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #4 - Posted 2009-12-09 09:25:12 »

Hi

You seem to have a very niche market. There are not a huge number of people with 360 controllers connected to Java games. If supporting those 2 features for that small number of people is that important to you, maybe switching is worth it. I've yet to see it being that important, which is why I've neither changed techs, or implemented the plugin.

Endolf

Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #5 - Posted 2009-12-09 09:55:28 »

Aw man that sucks, gah maybe I should just switch over to C# & XNA.

Which, rather frustratingly, supports all the 360's functionality, but very little of any other controller. Frankly I think MS really screwed up with XInput by fragmenting the controller support. The presense of XBCD (which is a custom driver which makes all of the 360 pad usable via DirectInput) suggests that MS deliberately nerfed the DI support rather than any hardware limitation.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Nate

« JGO Bitwise Duke »


Medals: 158
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #6 - Posted 2009-12-09 19:44:54 »

aoen, you can use this class to read state from an Xbox 360 controller (which in turn uses JInput):
http://code.google.com/p/pg3b/source/browse/trunk/Java/src/pg3b/XboxController.java
Everything works, except for the Guide button and Start button. I know the Guide button doesn't work even with XNA. Not sure about the Start button. Oh, I didn't bother with the vibration. You might be able to get that to work through JInput.

Offline Nate

« JGO Bitwise Duke »


Medals: 158
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2009-12-12 10:04:54 »

I wrote a tiny native lib to access XInput, which is MS's Xbox 360 controller API. It differs from DirectInput in that you can access the start button and the left and right triggers do not share the same axis. The latter is a huge issue, eg in a racing game you might want to press both triggers simultaneously to brake and gas, but with DirectInput this will result in +1 and -1 on the same axis, so you get 0 (which means neither trigger is pressed!). XInput provides access to the rumblers, but I don't have the need for those.

The native code is only a couple lines (XInput is very simple):
http://code.google.com/p/pg3b/source/browse/trunk/Java/jni/xinput/xinput.c

I wrote a little abstraction layer that seamlessly provides Xbox 360 controller access with XInput on Windows, and JInput everywhere else:
http://code.google.com/p/pg3b/source/browse/#svn/trunk/Java/src/pg3b/xboxcontroller

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xFryIx (62 views)
2014-11-13 12:34:49

digdugdiggy (41 views)
2014-11-12 21:11:50

digdugdiggy (36 views)
2014-11-12 21:10:15

digdugdiggy (30 views)
2014-11-12 21:09:33

kovacsa (53 views)
2014-11-07 19:57:14

TehJavaDev (56 views)
2014-11-03 22:04:50

BurntPizza (55 views)
2014-11-03 18:54:52

moogie (70 views)
2014-11-03 06:22:04

CopyableCougar4 (71 views)
2014-11-01 23:36:41

DarkCart (156 views)
2014-11-01 14:51:03
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!