Microsoft DirectX 8.1 (Visual Basic)

DirectInputDevice8.SetActionMap

Sets the data format for a device and maps application-defined actions to device objects. It also sets the buffer size for buffered data.

Note

The device must be unacquired prior to calling this method.

object.SetActionMap(format As DIACTIONFORMAT, _
  userName As String, _
  flags As Long)

Parts

object
Resolves to a DirectInputDevice8 object.
format
DIACTIONFORMAT type that specifies information about the action map to be applied and about the buffer size for buffered device data.
userName
Value of type String that specifies the name of the user.
flags
Value of type Long that specifies how the action map is applied. Can be one of the constants of the CONST_DIDSAMFLAGS enumeration.

Error Codes

If the method fails, Err.Number can be set to one of the following values.

DIERR_ACQUIRED
DIERR_INVALIDPARAM

Remarks

This method provides the mechanism to change action-to-control mapping from the device defaults. An application must use this method to map its actions to virtual controls.

The user name passed to this method binds a set of action mappings for a device to a specific user. Settings are automatically saved to disk when they differ from the currently applied map. Applications that accept input from multiple users should be very careful when applying action maps to the system mouse or keyboard, as the action maps for each user may conflict.

The method can be called only when the device is not acquired.

See Also

DirectInputDevice8.BuildActionMap