Go to Post If sponsors are only interested in blue banners and trophies, then they don't get it. - Taylor [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-02-2011, 18:27
katiebelle katiebelle is offline
Registered User
FRC #1622
 
Join Date: Jan 2011
Location: California
Posts: 4
katiebelle is an unknown quantity at this point
Logitech Gamepad: Dpad programming?

Does anyone know what axis the dpad is called on the logitech controller?
Reply With Quote
  #2   Spotlight this post!  
Unread 21-02-2011, 18:37
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
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;
Reply With Quote
  #3   Spotlight this post!  
Unread 21-02-2011, 19:40
katiebelle katiebelle is offline
Registered User
FRC #1622
 
Join Date: Jan 2011
Location: California
Posts: 4
katiebelle is an unknown quantity at this point
Re: Logitech Gamepad: Dpad programming?

Thanks for the help.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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