Microsoft DirectX 8.1 (Visual Basic)

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 type containing the DIACTIONFORMAT type describing the desired mapping, along with the DICD_EDIT flag, to the DirectInput8.ConfigureDevices method. Normally you would do this after calling DirectInputDevice8.BuildActionMap on all devices that will be used in the application.

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

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

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 ActionName member of each DIACTION type. If you have already called 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 type that you passed in. You can now pass the same type to DirectInputDevice8.SetActionMap in order to implement the new mapping scheme.