Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Logitech Gamepad: Dpad programming? (http://www.chiefdelphi.com/forums/showthread.php?t=92607)

katiebelle 21-02-2011 18:27

Logitech Gamepad: Dpad programming?
 
Does anyone know what axis the dpad is called on the logitech controller?

Dave Scheck 21-02-2011 18:37

Re: Logitech Gamepad: Dpad programming?
 
You may want to check out the class that's posted here.

To directly answer your question though, it's a combination of axes 5 (x) and 6 (y).
Code:

if (x < -0.5 && y < -0.5)
        return kUpLeft;
    if (x < -0.5 && y > 0.5)
        return kDownLeft;
    if (x > 0.5 && y > 0.5)
        return kDownRight;
    if (x > 0.5 && y < -0.5)
        return kUpRight;
    if (y < -0.5)
        return kUp;
    if (x < -0.5)
        return kLeft;
    if (y > 0.5)
        return kDown;
    if (x > 0.5)
        return kRight;

    return kCenter;


katiebelle 21-02-2011 19:40

Re: Logitech Gamepad: Dpad programming?
 
Thanks for the help.


All times are GMT -5. The time now is 17:43.

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