Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Button Layout on Dual Shock 4 (http://www.chiefdelphi.com/forums/showthread.php?t=136762)

Cinnamon Toast 04-19-2015 11:53 AM

Button Layout on Dual Shock 4
 
Hello Everyone,

For the longest time, we have been using the Logitech dual shock controller as our main driving controller.Recently we moved to a PlayStation DualShock 4 controller for ergonomic reasons. So far it's been working great. Via the attached micro USB cable connection (cause sadly we can't use blutooth) control is normal, as the mapping pretty much stayed the same. One thing that we've never used though (and I would like to start using) are the D-pad buttons on the controller. Now, in the driver station they don't recognize as buttons, but rather the POV hat I believe. That being said, I'm not sure that I can reference them they same way I do buttons in code.

gamepad.GetRawButton(some number here)

That's how I would normally reference all the other buttons, but how do I reference the D-pad buttons in C++? I would appreciate any help possible!

-Cinnamon Toast

ghead 04-19-2015 12:54 PM

Re: Button Layout on Dual Shock 4
 
Use the GetPOV() method of Joystck to get the current DPad reading. We've used something similar to this in the past::

Code:

switch (m_driveStick.GetPOV())
    {
        case 0:
            // Do Something - the 'up' button
            break;

        case 90:
            // Do Something - the 'right' button
            break;

        case 180:
            // Do Something - down
            break;

        case 270:
            // Do Something - left
            break;

        default:
            break;
    }


Cinnamon Toast 04-19-2015 01:01 PM

Re: Button Layout on Dual Shock 4
 
Just to be clear it looks as if the d-pad buttons are referenced via angles going clockwise? And if two are referenced such as to give an angle in between 90 degree steps, just account for that with a split angle?

cobzar 05-15-2015 12:52 PM

Re: Button Layout on Dual Shock 4
 
What are you guys using as far as gaming controllers for your tablets? I have a PS3 and Xbox One controller at home. Just wondering if either can be easily used to play on my dragon touch m8 tablet. :confused:


All times are GMT -5. The time now is 10:46 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi