11/7/2022 0 Comments Gamemaker studio 2 gamepadWindows/Firefox: “054c-09cc-Wireless Controller”ĭetecting the controller type via this string is probably not going to end up not being very reliable for PlayStation controller cases, especially in browsers.Windows/Chrome: “Wireless Controller (STANDARD GAMEPAD Vendor: 054c Product: 09cc)”.My offical PlayStation 4 controller gave me these values: Windows/Chrome: “Xbox 360 Controller (XInput STANDARD GAMEPAD)”.Windows/Game Maker: “XInput STANDARD GAMEPAD”.Windows/GLFWv3.2: “Xbox 360 Controller”.As you can see with the examples below, you’re at the mercy of your driver, engine or browser when it comes to getting a name for your gamepad.įor example, my unofficial Xbox One Controller gave me these string values: You might think that we would be able to at least fuzzily determine what controller we are using with these functions but unfortunately it’s not that simple. SDL2: SDL_GameControllerNameForIndex(0).It’s a much smoother experience for the end-user if a game says “Press A to Jump” rather than saying “Press Button0 to Jump” or “Press to Jump”.Īfter some initial investigation, the first thing I thought to do was call one of these functions to get the gamepad name: I wanted to detect if a user is using a fairly modern Xbox or PlayStation controller and then make the in-game instructions be more precise for those controllers. I’m currently on a bit of holiday leave from my full-time web dev gig and I wanted to spend some time improving the gamepad support in my newly released puzzle game, Give Up The Dupe. You Can’t Just: Query if a controller is for Xbox or PlayStation
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |