Share via


DIACTION

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

Syntax

typedef struct _DIACTION {
    UINT_PTR    uAppData;
    DWORD       dwSemantic;
    DWORD       dwFlags;
    union {
        LPCTSTR lptszActionName;
        UINT    uResIdString;
    };
    GUID        guidInstance;
    DWORD       dwObjID;
    DWORD       dwHow;
} DIACTION, *LPDIACTION;
 
typedef const DIACTION *LPCDIACTION;

Members

  • 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.

    • DIA_APPFIXED
      The action cannot be remapped by DirectInput.
    • DIA_APPMAPPED
      The dwObjID member is valid, and IDirectInputDevice8::BuildActionMap will not override the application-defined mapping.
    • DIA_APPNOMAP
      This action is not to be mapped.
    • DIA_FORCEFEEDBACK
      The action must be mapped to an actuator or trigger.
    • DIA_NORANGE
      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.

    • DIAH_APPREQUESTED
      The mapping was configured by the application, which specified the device (guidInstance) and device object (dwObjID) when calling IDirectInputDevice8::BuildActionMap.
    • DIAH_DEFAULT
      The mapping was determined by DirectInput in the absence of other mapping information.
    • DIAH_ERROR
      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.
    • DIAH_HWAPP
      The mapping was specified by the hardware manufacturer for this game.
    • DIAH_HWDEFAULT
      The mapping was specified by the hardware manufacturer for this genre.
    • DIAH_UNMAPPED
      No suitable device object was found.
    • DIAH_USERCONFIG
      The mapping was configured by the user.

See Also

IDirectInput8::EnumDevicesBySemantics
IDirectInputDevice8::SetActionMap
IDirectInput8::ConfigureDevices
IDirectInputDevice8::BuildActionMap