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.

Dark GDK / Joystick Top-Hat ID

Author
Message
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 25th Jun 2008 16:57
Hi All,

I am trying to integrate the Top Hat control on a joystick to enable directional views from an aircraft cockpit.

All the other Joystick controls have been straight forward so far.

To find Top-Hat position we use:
int dbJoystickHatAngle ( int iHat )

"iHat" is an ID number to distinguish between up to 4 different Top-Hat controls on one joystick.

What value does "int iHat" have to have to address the first Top-Hat?

Are the Top-Hat numbers going from 0 to 3, or 1 to 4, or is it some other number set that is determined from elsewhere?

Any information would be greatly appreciated as all my searches have come up empty.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 25th Jun 2008 18:04
0 to 3...gleaned from the sample program that comes from DBPro.

The DirectX SDK has the following additional information:

rgdwPOV

Direction controllers, such as point-of-view hats. The position is indicated in hundredths of a degree clockwise from north (away from the user). The center position is normally reported as - 1; but see Remarks. For indicators that have only five positions, the value for a controller is - 1, 0, 9,000, 18,000, or 27,000.
.
.
.
Remarks.
.
.
Some drivers report the centered position of the POV indicator as 65,535. Determine whether the indicator is centered as follows:

BOOL POVCentered = (LOWORD(dwPOV) == 0xFFFF);
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 25th Jun 2008 18:59 Edited at: 25th Jun 2008 19:01
Thanks for that.

So the ID number for the first Top-Hat will be "0".

There is still a discrepancy between what is from your documentation and what is in our documents from DarkGDK.


Quote: "For indicators that have only five positions, the value for a controller is - 1, 0, 9,000, 18,000, or 27,000. "



Our documentation says

Quote: "When the hat is being used, the return value is in tens of a degree so north would be zero, east would be 900, south is 1800 and west is 2700."


Anyway some experimentation will soon tell us what we have to use
sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 25th Jun 2008 19:32
Have just confirmed that the information about Top-Hat controller measurements is actually in 1/100 of a degree as stated in the DirectX SDK is correct and the information about it being in 1/10 of a degree as stated in DarkGDK is WRONG.

Login to post a reply

Server time is: 2024-09-30 01:25:18
Your offset time is: 2024-09-30 01:25:18