MineKhan icon indicating copy to clipboard operation
MineKhan copied to clipboard

Xbox One Controller support

Open ImaginaryNeon opened this issue 3 years ago • 12 comments

Bottom Text

ImaginaryNeon avatar Oct 23 '21 12:10 ImaginaryNeon

I don't own any Bluetooth controllers, so I have no way of working on this. It's definitely something I'd be interested in adding though.

Willard21 avatar Oct 23 '21 13:10 Willard21

If you have an Xbox 1 controller, you can plug it in btw

ImaginaryNeon avatar Oct 23 '21 13:10 ImaginaryNeon

I have nothing but PS2 and wireless Xbox 360 controllers.

Willard21 avatar Oct 23 '21 14:10 Willard21

Yes, but then your code must be able to find a way of connecting to the controller, + on different operating systems it is different, and not all of us use windows (I don't, using Linux Ubuntu 20.04).

Elite230 avatar Oct 27 '21 10:10 Elite230

It doesn't matter what operating system you use. That's the whole point of the web. I'm on Ubuntu 20.04 too. https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API has a tutorial. All I'd really need to do is map the controls and add a cursor for the menus, plus a few lines for connecting. But again, I have no way of testing, and trying to code without being able to run the code is futile lol

Willard21 avatar Oct 27 '21 12:10 Willard21

if it connects to something like this then you can use it. but I don't know much about PlayStation or Xbox controllers (even though I have an Xbox controller (don't know if it's Xbox 1, just says "Xbox Wireless controller") that I bought mostly just for use with the Gamepad API)

sauron65 avatar Oct 28 '21 15:10 sauron65

Well the PS2 was released in the year 2000, so it definitely isn't compatible with any computers. Xbox 360 was released in 2005, and their wireless controllers use a "proprietary 2.4 GHz protocol", meaning they won't connect directly to a computer. That's the same frequency as wifi, so it might theoretically be able to connect to the wifi adapter if you had the right drivers, but seeing as I'm already using those adapters to connect to the internet, there's no chance.

Willard21 avatar Oct 28 '21 16:10 Willard21

Hello Willard!

I could beta test this feature due to the fact that I own an Xbox One controller. Even though the one I have is from 2014-ish, it will be able to work with a micro-USB --> USB connector. I think you have seen already that the Mozilla documentation does have a thing or two about Gamepad API and libraries that you can incorporate.

To be fair, I do own Mac and Windows machines, my Mac running on macOS Monterey and my Windows PC running on standard Windows 10.

Just a little inquiry I had, is there any difference between how the Gamepad API is received on Unix-like systems or does it react the same throughout all OS's, whether or not they are Unix-based.

PS4 controllers are a little finicky to connect to a PC, while newer Xbox Controllers (Mine is old, so it doesn't have this feature) will be able to tether to Windows Bluetooth automatically, the only action needed is syncing it using the sync button. I am not sure whether Mozilla and JS environments in general will be finicky towards non-OS based gamepads, but taught is just a matter of testing :)

Hope I didn't barge in completely, but I am a member of KACC so I would be happy to help with anything y'all need lol

Mist-Pompano avatar Oct 30 '21 13:10 Mist-Pompano

Yeeeah that wouldn't work. I typically run code dozens of times to figure out what works, print objects to console to explore what values are stored, etc., none of which is possible if I can't run my own code. Having someone else do it would turn 30 minutes of coding into like 12 hours.

Willard21 avatar Oct 30 '21 14:10 Willard21

i mean could you show the movement lines maybe someone with a controller like me could try and add support

harsha7addanki avatar Apr 17 '23 21:04 harsha7addanki

I Just Checked They Willard Does Movement And Key Presses woud make it pacticly imposible to have both controller and keyy board support

harsha7addanki avatar Jun 29 '23 12:06 harsha7addanki

I suggest we close this issue and leave it to when we have modding support

harsha7addanki avatar Feb 24 '24 20:02 harsha7addanki