Microsoft DirectX 9.0

User Configuration of the Device

Microsoft?DirectInput?provides a property sheet that can be called from an application, enabling the user to configure devices for the application and view the current configuration. This property sheet can display various views of the device as provided by the manufacturer.

To enable user configuration, pass a DICONFIGUREDEVICESPARAMS structure containing a pointer to the DIACTIONFORMAT structure describing the desired mapping, along with the DICD_EDIT flag, to the IDirectInput8::ConfigureDevices method. Normally you would do this after calling IDirectInputDevice8::BuildActionMap on all devices that will be used in the application.

The following illustration shows a typical property sheet in edit mode.

Graphical user interface for configuring the action map

If the device manufacturer has not provided a device image, the mapping will be presented in text mode as in the following diagram.

Text user interface for configuring the action map

Note  Even if the cooperative level for the application is disabling the Microsoft Windows?logo key passively through an exclusive cooperative level or actively through use of the DISCL_NOWINKEY flag, that key will be active while the default action mapping UI is displayed.

The property page for a device lists the friendly names that were provided by you in the lptszActionName member of each DIACTION structure. If you have already called IDirectInputDevice8::BuildActionMap for a device, the page also shows these names as callouts on the image of the device, with lines pointing to the device objects to which the actions have been mapped.

The user now has the opportunity to reassign game actions by first choosing a control then choosing an action from the menu. When the user closes the property sheet, the method returns and the modifications are stored in the DIACTIONFORMAT structure that you passed in. You can now pass the same structure to IDirectInputDevice8::SetActionMap in order to implement the new mapping scheme.

© 2002 Microsoft Corporation. All rights reserved.