_BUTTON
#14
(04-09-2023, 03:46 AM)SMcNeill Wrote: Some of those buttons might be the D-pad, but I'd think setting up an user-config would probably be the best way to handle things as there's just so many unique input systems out there.  What if someone has a wheel and peddles attached to their PC?  Wouldn't it detect as a device, and wouldn't pressing the peddles down either be an axis event or a button event, depending on how they're configured?   Having a screen where the user "Press UP on the controller".... "Press DOWN on the controller"...and so on, seems the simplest way to detect WHICH controller they want to interact with (what if they have multiple hooked up to the PC?), and which buttons they're most comfortable with using for their games.

I agree with having the user polled for controller input: "Press UP on the controller". I already have that functionality built into the driver and it does work very well.

All of the D-Pads (and top hats) on all of the game pads and joysticks/flight yokes I have identify as axis inputs. -1 (UP), 1 (DOWN), -1 (LEFT), and 1 (RIGHT). The driver I wrote converts these to buttons for easier handling since a full range of values between -1 and 1 are not utilized.

My driver also detects up to six controllers (optional keyboard, optional mouse, and up to six joysticks/game pads) and keeps track of all buttons, axis, and wheels on all controllers automagically, so no issue with multiple controllers. When I get the driver finished I'll upload it so everyone can use it.

What puzzles me is this crazy clone Nintendo controller I have. Even though it reports the incorrect number of buttons and the buttons that it does have map to strange button numbers, most of my games  and emulators that can use a game pad seem to have no issue with it without having to describe the button layout.

That's what made me wonder if there was a way to poll a controller for actual "working" buttons versus the number of "reported" buttons. The descriptive name identified by the game pad is "USB GamePad" so software isn't getting any help there unlike my joystick that identifies itself as "Saitek ST290 Pro" which gives software a clue as to its features.
Software and cathedrals are much the same — first we build them, then we pray.
QB64 Tutorial
Reply


Messages In This Thread
_BUTTON - by TerryRitchie - 04-03-2023, 02:42 AM
RE: _BUTTON - by TerryRitchie - 04-03-2023, 08:40 PM
RE: _BUTTON - by dbox - 04-03-2023, 11:07 PM
RE: _BUTTON - by TerryRitchie - 04-04-2023, 02:25 AM
RE: _BUTTON - by dbox - 04-04-2023, 03:34 AM
RE: _BUTTON - by SMcNeill - 04-03-2023, 09:03 PM
RE: _BUTTON - by TerryRitchie - 04-03-2023, 09:16 PM
RE: _BUTTON - by SMcNeill - 04-03-2023, 09:04 PM
RE: _BUTTON - by TerryRitchie - 04-03-2023, 09:26 PM
RE: _BUTTON - by RhoSigma - 04-03-2023, 10:03 PM
RE: _BUTTON - by TerryRitchie - 04-04-2023, 02:24 AM
RE: _BUTTON - by TerryRitchie - 04-09-2023, 01:17 AM
RE: _BUTTON - by SMcNeill - 04-09-2023, 03:46 AM
RE: _BUTTON - by TerryRitchie - 04-09-2023, 05:12 AM



Users browsing this thread: 6 Guest(s)