Describes a mapping of one game action to one device semantic. An array of DIACTION structures is contained by a DIACTIONFORMAT structure.


typedef struct _DIACTION {
    UINT_PTR    uAppData;
    DWORD       dwSemantic;
    DWORD       dwFlags;
    union {
        LPCTSTR lptszActionName;
        UINT    uResIdString;
    GUID        guidInstance;
    DWORD       dwObjID;
    DWORD       dwHow;


  • uAppData
    Address of an application-defined UINT value to be returned to the application by IDirectInputDevice8::GetDeviceData when the state of the control associated with the action changes. This value is returned in the uAppData member of the DIDEVICEOBJECTDATA structure. It is typically an identifier for the application-specific action associated with the device object, but can also be a function pointer.

  • dwSemantic
    For a joystick, a predefined action mapping constant for this application genre representing a virtual control or a constant for a control not defined in the genre. For a keyboard or mouse, a constant that represents a particular device object. See Action Mapping Constants.

  • dwFlags
    Flags used to request specific attributes or processing. Can be zero or one or more of the following values.

      The action cannot be remapped by DirectInput.
      The dwObjID member is valid, and IDirectInputDevice8::BuildActionMap will not override the application-defined mapping.
      This action is not to be mapped.
      The action must be mapped to an actuator or trigger.
      The default range is not to be set for this action. This flag can be set only for absolute axis actions.
  • lptszActionName
    Application-defined name of the action. This string is displayed by the device property sheet when IDirectInput8::ConfigureDevices is called.

  • uResIdString
    Resource identifier for the string for this action. The module instance for this resource is specified in the hInstString member of the DIACTIONFORMAT structure that contains this structure.

  • guidInstance
    Device instance globally unique identifier (GUID) if a specific device is requested. Otherwise GUID_NULL.

  • dwObjID
    Control identifier. Use the DIDFT_GETINSTANCE and DIDFT_GetType macros to retrieve the instance and type from this value.

  • dwHow
    When the structure is returned by IDirectInputDevice8::BuildActionMap, this member receives a value to indicate the mapping mechanism used by DirectInput to configure the action. This member is ignored when the action map is passed to IDirectInputDevice8::SetActionMap. The following values are defined.

      The mapping was configured by the application, which specified the device (guidInstance) and device object (dwObjID) when calling IDirectInputDevice8::BuildActionMap.
      The mapping was determined by DirectInput in the absence of other mapping information.
      An error occurred. The action cannot be matched to a control on the device. The action will be ignored when the action map is set.
      The mapping was specified by the hardware manufacturer for this game.
      The mapping was specified by the hardware manufacturer for this genre.
      No suitable device object was found.
      The mapping was configured by the user.

See Also