Platform SDK: DirectX

DirectInputDevice.GetProperty

The DirectInputDevice.GetProperty method retrieves information about the input device.

object.GetProperty( _ 
  guid As String, _ 
  propertyInfo As Any)

Parameters

object
Object expression that resolves to a DirectInputDevice object.
guid
Identifier of the property to be retrieved. The following properties are defined for an input device and can be passed as strings:
DIPROP_AUTOCENTER
Specifies whether device objects are self-centering. See DirectInputDevice.SetProperty for more information.
DIPROP_AXISMODE
Retrieves the axis mode. The retrieved value can be DIPROPAXISMODE_ABS or DIPROPAXISMODE_REL. (See the CONST_DINPUT enumeration.)
DIPROP_BUFFERSIZE
Retrieves the input-buffer size. The buffer size determines the amount of data that the buffer can hold between calls to the DirectInputDevice.GetDeviceData method before data is lost. This value may be set to 0 to indicate that the application will not be reading buffered data from the device.
DIPROP_DEADZONE
Retrieves a value for the dead zone of a joystick, in the range 0 to 10,000, where 0 indicates there is no dead zone, 5,000 indicates that the dead zone extends over 50 percent of the physical range of the axis on both sides of center, and 10,000 indicates that the entire physical range of the axis is dead. When the axis is within the dead zone, it is reported as being at the center of its range.
DIPROP_FFGAIN
Retrieves the gain of the device. See DirectInputDevice.SetProperty for more information.
DIPROP_FFLOAD
Retrieves the memory load for the device. This setting applies to the entire device, rather than to any particular object, so the lHow member of the associated DIPROPLONG type must be DIPH_DEVICE.

The lData member contains a value in the range 0 to 100, indicating the percentage of device memory in use.

DIPROP_GRANULARITY
Retrieves the input granularity. Granularity represents the smallest distance the object will report movement. Most axis objects have a granularity of 1, meaning that all values are possible. Some axes may have a larger granularity. For example, the wheel axis on a mouse may have a granularity of 20, meaning that all reported changes in position will be multiples of 20. In other words, when the user turns the wheel slowly, the device reports a position of 0, then 20, then 40, and so on.

This is a read-only property; you cannot set its value by calling the DirectInputDevice.SetProperty method.

DIPROP_RANGE
Retrieves the range of values an object can possibly report. The retrieved minimum and maximum values are set in the lMin and lMax members of the associated DIPROPRANGE type.

For some devices, this is a read-only property; you cannot set its value by calling the DirectInputDevice.SetProperty method.

DIPROP_SATURATION
Retrieves a value for the saturation zones of a joystick, in the range 0 to 10,000. The saturation level is the point at which the axis is considered to be at its most extreme position. For example, if the saturation level is set to 9,500, then the axis reaches the extreme of its range when it has moved 95 percent of the physical distance from its center position (or from the dead zone).
propertyInfo
A DIPROPLONG type to receive a single value, or a DIPROPRANGE type to receive a pair of values for the property. The lObj, lHow, and lSize members of this type must be initialized before the method is called.

Error Codes

If the method fails, an error is raised and Err.Number may be one of the following error codes:

DIERR_INVALIDPARAM
DIERR_OBJECTNOTFOUND
DIERR_UNSUPPORTED

See Also

DirectInputDevice.SetProperty