Table of contents
TOC
Collapse the table of content
Expand the table of content

Setting Up AddReg Entries

Last Updated: 8/3/2016

The INF file also needs to set up registry entries in the section selected by the AddReg entry of the install section. For devices requiring a minidriver, the following need to be set up to make sure that the driver is properly associated with the multimedia system drivers:

HKR,,DevLoader,,mmdevldr.vxd
HKR,Drivers,,,
HKR,Drivers,MIGRATED,,0
HKR,Drivers\joystick,,,
HKR,,Driver,,vjoyd.vxd
HKR,Drivers\joystick\msjstick.drv,,,
HKR,Drivers\joystick\msjstick.drv,Description,,%OEMJoy.DeviceDesc%
HKR,Drivers\joystick\msjstick.drv,Driver,,msjstick.drv

The %OEMJoy.DeviceDesc% string is replaced by whatever the device name string has been called.

Values that describe this joystick are put into the registry under an OEM-defined key, starting with the path REGSTR_PATH_JOYOEM (found under HKEY_LOCAL_MACHINE). Under this key, an OEM can place a number of static values that customize the way an OEM joystick appears in the joystick calibration program and to applications for Windows 95/98/Me. The names of the values are defined in Regstr.h, so it is the names of these constants that are discussed below, rather than the names that appear in the registry. Every OEM-defined device must at least have its basic properties defined and a name that the user can see in the joystick selection box under Control Panel. For a minidriver to be loaded, the value must contain the name of the minidriver VxD (including the .vxd extension). The OEM name value (REGSTR_VAL_JOYOEMNAME), and the minidriver file name(REGSTR_VAL_JOYOEMCALLOUT) values are simple strings. The basic properties REGSTR_VAL_JOYOEMDATA value is binary data, whose meaning is detailed in the following passages.

There are two doublewords; the first contains a set of flags, the second is the number of buttons the device has.

The flags specify what kind of device it is, which axes are present, and how they should be interpreted.

Most of the flags are defined in Mmddk.h. The two new flags added in DirectX 3.0 are defined in Dinput.h. The following flags are used only to remap the axes of an OEM-defined analog joystick that is polled directly by VJoyD. They change the default behavior of VJoyD when doing analog polling, but have no effect on the data returned by minidrivers.

JOY_HWS_XISJ1Y

X is on the J1 Y axis.

JOY_HWS_XISJ2X

X is on the J2 X axis.

JOY_HWS_XISJ2Y

X is on the J2 Y axis.

JOY_HWS_YISJ1X

Y is on the J1 X axis.

JOY_HWS_YISJ2X

Y is on the J2 X axis.

JOY_HWS_YISJ2Y

Y is on the J2 Y axis.

JOY_HWS_RISJ1X

R is on the J1 X axis.

JOY_HWS_RISJ1Y

R is on the J1 Y axis.

JOY_HWS_RISJ2Y

R is on the J2 Y axis.

JOY_HWS_ZISJ1X

Z is on the J1 X axis.

JOY_HWS_ZISJ1Y

Z is on the J1 Y axis.

JOY_HWS_ZISJ2X

Z is on the J2 X axis.

JOY_HWS_POVISJ1X

Polled POV is on the J1 X axis.

JOY_HWS_POVISJ1Y

Polled POV is on the J1 Y axis.

JOY_HWS_POVISJ2X

Polled POV is on the J2 X axis.

The default behavior is:

  • X defaults to the J1 X axis.

  • Y defaults to the J1 Y axis.

  • R (rudder) defaults to the J2 X axis.

  • Z defaults to the J2 Y axis.

  • POV hat (if implemented as polling) defaults to the J2 Y axis.

Flags are also defined to determine whether POV data comes from an axis or from a button combination. If the described device is being polled by VJoyD, JOY_HWS_POVISBUTTONCOMBOS causes VJoyD to interpret button combinations to produce the POV, otherwise an axis is used to find it. If the described device is polled through a minidriver, then a value in dwPOV other than POV_UNDEFINED causes an override of any other POV calculation. However, if JOY_HWS_POVISBUTTONCOMBOS is set, VJoyD interprets the buttons as it would for an analog joystick. Otherwise the POV is taken from the Z axis value if JOY_HWS_HASZ is not set, from R otherwise. When possible, minidrivers should avoid having the generic VJoyD interpret POV information, as a minidriver usually has more information about the hardware implementation.

The following flags are used to describe which features the device has:

JOY_HWS_HASZ

Joystick has Z (3rd axis) information.

JOY_HWS_HASR

Joystick has R (4th axis) information.

JOY_HWS_HASU

Joystick has R (4th axis) information.

JOY_HWS_HASV

Joystick has R (4th axis) information.

JOY_HWS_HASPOV

Joystick has a POV hat.

The following flags are used to describe the device type:

JOY_HWS_ISYOKE

Device is a flight yoke.

JOY_HWS_ISGAMEPAD

Device is a game pad.

JOY_HWS_ISCARCTRL

Device is a race car controller.

JOY_HWS_ISHEADTRACKER

Device is a head tracker (defined in DirectX 3.0).

Finally, the JOY_HWS_ISGAMEPORTDRIVER flag that was added in DirectX 3.0 indicates that this minidriver replaces the standard polling of a game port.

For example, if you have a digital joystick that has eight buttons and returns values for X, Y, Z, R, and POV, then you need to set the bits JOY_HWS_HASZ, JOY_HWS_HASPOV, and JOY_HWS_HASR. This gives you the following:

0x00000001

JOY_HWS_HASZ

01,00,00,00

|

0x00000002

JOY_HWS_HASPOV

02,00,00,00

|

0x00080000

JOY_HWS_HASR

00,00,08,00

=

0x00080003

combination

03,00,08,00

Putting this DWORD in little-endian format, followed by a DWORD for the number of buttons, gives you 03,00,08,00,08,00,00,00, which is the series of bytes required in your INF file.

All of the remaining registry settings supplied in the INF file customize the instructions for calibration given by the standard control panel, and are as follows:

REGSTR_VAL_JOYOEMXYLABEL
This string is displayed below the XY position control found in the test and calibrate dialogs of the joystick CPL.

REGSTR_VAL_JOYOEMZLABEL
This string is displayed below the Z position control found in the test and calibrate dialogs of the joystick CPL.

REGSTR_VAL_JOYOEMRLABEL
This string is displayed below the R position control found in the test and calibrate dialogs of the joystick CPL.

REGSTR_VAL_JOYOEMPOVLABEL
This string is displayed below the POV hat control found in the test and calibrate dialogs of the joystick CPL.

REGSTR_VAL_JOYOEMULABEL
This string is displayed below the U position control found in the test and calibrate dialogs of the joystick CPL.

REGSTR_VAL_JOYOEMVLABEL
This string is displayed below the V position control found in the test and calibrate dialogs of the joystick CPL.

REGSTR_VAL_JOYOEMTESTMOVEDESC
This string is displayed in the movement section of the test dialog. It describes to the user how to test the joystick.

REGSTR_VAL_JOYOEMTESTBUTTONDESC
This string is displayed in the button section of the test dialog. It describes to the user how to test the buttons.

REGSTR_VAL_JOYOEMTESTMOVECAP
This string is displayed as the caption of the group box surrounding the movement section of the test dialog.

REGSTR_VAL_JOYOEMTESTBUTTONCAP
This string is displayed as the caption of the group box surrounding the button section of the test dialog.

REGSTR_VAL_JOYOEMTESTWINCAP
This string is displayed as the caption of the test dialog.

REGSTR_VAL_JOYOEMCALCAP
This string will be displayed as the caption of the calibration dialog.

REGSTR_VAL_JOYOEMCALWINCAP
This string is displayed as the caption of the calibration dialog.

REGSTR_VAL_JOYOEMCAL1
This string instructs the user how to center the XY portion of the joystick for calibration.

REGSTR_VAL_JOYOEMCAL2
This string instructs the user how to move the XY portion of the joystick for calibration.

REGSTR_VAL_JOYOEMCAL3
This string instructs the user how to recenter the XY portion of the joystick for calibration.

REGSTR_VAL_JOYOEMCAL4
This string instructs the user how to move the Z portion of the joystick for calibration.

REGSTR_VAL_JOYOEMCAL5
This string instructs the user how to move the R portion of the joystick for calibration.

REGSTR_VAL_JOYOEMCAL6
This string instructs the user how to move the U portion of the joystick for calibration.

REGSTR_VAL_JOYOEMCAL7
This string instructs the user how to move the V portion of the joystick for calibration.

REGSTR_VAL_JOYOEMCAL8
This string instructs the user how to move the POV hat up for calibration.

REGSTR_VAL_JOYOEMCAL9
This string instructs the user how to move the POV hat right for calibration.

REGSTR_VAL_JOYOEMCAL10
This string instructs the user how to move the POV hat down for calibration.

REGSTR_VAL_JOYOEMCAL11
This string instructs the user how to move the POV hat left for calibration.

REGSTR_VAL_JOYOEMCAL12
This string consists of a message that informs the user that the calibration process is finished.


Send comments about this topic to Microsoft

© 2016 Microsoft