Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Xbox One Controller

Author
Message
Barry Pythagoras
10
Years of Service
User Offline
Joined: 14th Mar 2014
Location:
Posted: 29th Feb 2020 10:57
I have a project in mind, and I need to send controller commands to the XBox One. If I could send commands to the controller then I think it would work.

Is there any way to send commands to the XBox One Controller?

Thanks!
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 29th Feb 2020 12:09
Dark BASIC Professional by default doesn't support XInput., and so the Xbox 360 / One Controller is only partially supported.
This said, I'd recommend doing a Forum Search as I developed an XInput Plug-In when Microsoft first released it (as part of DirectX 9.0c) and while I think I stopped updating it at XInput 1.3 ... it should still provide full support for Xbox (and XInput Compatible) Devices.
It just doesn't support things like the Chatpad, as at the time they weren't supported.

There is also the Unofficial "Modernisation" Update (forget the name of it) which upgrades Dark BASIC Professional to a more Modern DirectX (believe 9.0c is the "Stable" while 11.0 is the "WIP" version) and both replace the Windows Input (that DBP Officially used) with XInput, so you should be able to use the Native Commands.
Up to you which you go with, but Support should be available.
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 11th Mar 2020 03:40
When using an Xbox/360/One controller with Dark Basic Professional the triggers will cancel each other out. They are both tied to opposite ends of the same axis instead of separate axis'.

Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 11th Mar 2020 07:56
Yeah., which is why I said they're only Partially Supported.

XInput For Dark BASIC Professional

I decided to have a bit of a look for it.
To install it., what you want to do is copy the DBProXInput.Release.DLL into your %DarkBasicPro%/Compiler/plugins-user/ Folder (Debug doesn't work., which reading through the Thread, the issue seemed to be the opposite for DBP 1.07 when it was originally released; but both will work on DBP 1.06 or Earlier)

You will also need to copy the Editor and Help folders into the DBP Install Folder.
Editor Contains the Keywords, and Help updates the DBP Help as well as includes Examples

Now as a note., a key difference between the Xbox 360 and One Controllers is they're handled differently for Multiple Controllers.
As such, with the Xbox 360 Controller... the Connection Order (Top-Left, Top-Right, Bottom-Left, Bottom-Right) is Controller 0, 1, 2 and 3.
Thus you can have up to 4 Unique Xbox 360 Controllers (and Players) at once.

This doesn't however work with the Xbox One Controller.
Instead if there is 1 Connected, then they're ALL Connected... at least as best as I could tell from playing about with it a bit.



As a point-of-note... I don't have the source for it anymore, or at least I don't think it's on any of the HDD that I still own.
For some reason I never added Start and Back as Buttons to directly address (instead you have to get them via the Button Flags), and while it'll tell you if there is a Headset Connected (and it DOES still work with the Xbox One Controller) ... doesn't look like I ever actually got around to implementing capturing / sending audio to it.

Mind they do show up as System Audio Devices (MME / DirectSound) ... so eh, provided you know it's there it should be easy to access; as you know you're looking for Devices called "Xbox Headset" or such.

The Force Feedback does work., but obviously doesn't support the Haptic Force Feedback in the Triggers of the Xbox One Controller (mind it's quite an underused feature of them).

I could probably recreate and update it, if needed.

Login to post a reply

Server time is: 2024-04-18 03:30:19
Your offset time is: 2024-04-18 03:30:19