Microsoft DirectX 8.1 (Visual Basic) |
Once the mapping has been returned in the DIACTIONFORMAT type, it can be manipulated before being applied by DirectInputDevice8.SetActionMap.
The lHow member of each DIACTION type contained within the DIACTIONFORMAT type might be examined at this point to determine both whether the mapping was successful and what the criteria were in selecting the device object to which that action was mapped. For instance, you can determine if the mapping was specified by the hardware manufacturer or requested by the user.
You can change the actual mapping itself by editing the lSemantic member of the appropriate DIACTION structure returned in the default mapping. However, making these changes is not recommended.
Once the action-map configuration is finalized, it must be applied to the device to bind the physical controls to the game actions. This is done by calling the DirectInputDevice8.SetActionMap method as follows.
m_Devices(i).SetActionMap m_diaf, m_strUserName, 0
The parameters once again consist of the DIACTIONFORMAT type, the user name, and no flags.
Action maps, once created, can be displayed for and easily altered by the user. This is explained in Step 5: Displaying the Action Map.