Gamepad.js with XBox controller on Windows?


#1

Is gamepad.js supposed to work with an Xbox controller on Windows? It’s not working for me. And I notice in the Interface program directory there’s an SDL.dll file with a version number of only 1.2.14.0 and no SDL2.dll file.


#2

I bought myself a PS3 controller, is working fine in Windows driver properties and some DK2 demos.

Can confirm gamepad.js doesn’t recognise PS3 controllers either.

(Win7 64-bit)


#3

@davedub … to use the PS3 controller with Windows did you just plug it into the USB port with a direct cable and go… or did you have to install some drive support software extra?


#4

I’m pretty sure gamepad.js only works at present if you self-compile with the SDL2 libraries. Interface builds are meant to be being updated to include the necessary files but they’re not there yet: there’s still just a SDL.dll version 1.2.14 in the install directory whereas there should be a SDL2.dll (or maybe an SDL.dll version 2?).


#5

@Ai_Austin - I did install some drivers using MotionJoy and Better DS3, as per these instructions:

It all works quite well except the Bluetooth stuff, which I did manage to get running (sort of) but I was getting lots of BSODs whilst loading and unloading drivers. Fearing hard drive damage, I settled for no Bluetooth support. Without trying to enable Bluetooth things seem to work fine. (Win7 64-bit).

@ctrlaltdavid - It sound like the inclusion of the SDL2 libraries could be another worklist candidate?

  • davedub``

#6

Great, thanks @Davedub… I now have a PS3 controller working with CtrlAltStudio Seconbd Life/OpenSim viewer and my Rift and it emulates a “Xbox 360 Wireless Receiver for Windows” (even when plugged in to the USB port). I had to make sure I unplugged my Space Navigator as that was found first otherwise. I will try Bluetooth later given your BSOD experience.

I started Gamepad.js and restarted the viewer as well, but I have not yet managed to get the PS3 to move my avatar or camera or have any effect in the interface. Any special trick there… anything need enabling somewhere besides running Gampepad.js? Or are we waiting for the library that @ctrlaltdavid mentioned?

I made notes at
http://blog.inf.ed.ac.uk/atate/2014/11/06/ps3-controller-with-windows/


#7

I’ve just confirmed with @leo that the official Interface builds haven’t been updated to SDL2 but will be soon.


#8

Cool, will look forward to the SDL2 update. Will have another crack at the Bluetooth once that’s in, as with the Oculus and headphones on, I’m already sitting in a black wire spaghetti.

Even wired though, using the PS3 controller with some of the Oculus demos is way preferable to keyboard and mouse - will be great to have that freedom in HiFi.


#9

@ctrlaltdavid @davedub win builds 1410 and up come with SDL2 support. Please test and advise.

L


#10

@leo @ctrlaltdavid SDL2 did the trick - can confirm PS3 controller wired (i.e. no Bluetooth) working great on Win7 64-bit with MotionJoy drivers.

Left analog joystick controls motion in a very nice, smooth manner, right analog joystick left / right increments rotation in 15 degree increments. D-pad directions work (10 metre warps), but the fly up (right shoulder button) doesn’t seem to have the power to overcome gravity when standing on voxels.

Looks like I’m going to have to develop a diagonal walk now!

  • davedub

#11

@leo Thanks! It’s now working OK with my wireless Xbox 360 controller on Windows: same controller behaviour as @davedub except D-pad jumps in 1 metre increments.

Would be good to improve the right controller action to rotate avatar smoothly and pitch / view, I think.


#12

I could not get my Asus Bluetooth BT400 dongle to show in the PS3 setup pairing panel… though it worked fine with a Wacom BT tablet.


#13

@Ai_Austin - sorry I missed your reply - yep, the Bluetooth connectivity in MotionJoy is sketchy to say the least. The only times I got it to work (with frequent BSODs) was after I’d connected the PS3 controller via USB, then gone through the pairing process, then disconnected the USB cable. But this only worked sometimes, and when it did, I only got limited functionality (buttons working, but no analog joystick support)

Hope this helps,

  • davedub

#14

Thanks @davedub. Like you I had issues, and it would not recognise my relatively recent Bluetooth dongle either. But when I saw it needs a 1-1 between PS3 controller and dongle I decided to give it a skip anyway. It works fine wired via USB. When I can dedicate a controller and dongle to this I might try again. I find the PS3 controller much easier to use than the Xbox 360 one personally… but that’s just many years of Gran Turismo on the PlayStation :slight_smile:

http://blog.inf.ed.ac.uk/atate/2013/12/16/gran-turismo-6/


#15

@Ai_Austin - yep, the 1-1 thing precluding the simultaneous use of any other Bluetooth device is a pretty big limitation.

**However, I’ve just this done an update (MotionJoy 0.71001) and can confirm Bluetooth is working on the latest version :smile: **

I’ve had no BSODs with the new MotionJoy drivers yet either.

The default power off timeout on Bluetooth seemed a bit low, so I’ve increased it (can be set using MotionJoy or BetterDS3). Will check it out and report back here if there are any issues.

Out if interest, did you set the mode on the MotionJoy profile page to PS3 or XBox controller? I have both working, but selecting XBox for my PS3 controller seems to work better…

  • davedub

#16

I also am using MitioninJoy_0.71001_signed.exe but it did not recognise my Asus BT400 adapter.

I set the controller to Xbox 360 settings as I thought that would be most compatible with other programs, and it lets me use the PS3 with both CtrlAltStudio to get into OpenSim/Second Life and Linden Labs RIFT project viewer for Second Life. It also works then with the NoLimits Roller Coaster Simulator :slight_smile:


#17

gamepad.js seems broken and not working.

[04/08 16:18:37] [WARNING] [UncaughtException] ReferenceError: Can’t find variable: Joysticks in file:///w:/High Fidelity Scripts/gamepastest.js:15

Build 4667


#18

For what it’s worth - my XBox controller works with interface without need for any script at all for the basics - left thumb stick controls movement left,right,forward and backward. Right thumb controls vertical up,down and left,right turning. Buttons do various things but I haven’t sorted all of them out yet. I get that basic function set by simply turning on SDL input.


#19

That is the problem, the default button assignment is wrong. Not get used to it. forward,backward,and turn need to be on one stick. at least like to try it. strafe is not on logic place.

Also the you can move mouselook or something like that on the other stick.

Strafe can be assigned to buttons.

But none i can test, besides mouselook is not in the gamepad script too.

SDL works yes.


#20

Has this changed again? I have a generic xbox compatible gamepad, I plug it into a USB port, my Windows 7 system recognizes it, I find it in devices and run the calibration and button tests. Everything (in Windows) works fine.

I cannot figure out how to get HiFi to switch to this device. What is the trick?