DirectInputDevice8.GetProperty
Retrieves information about the input device.
object.GetProperty( _
guid As String, _
propertyInfo As Any)
Parts
- object
- Resolves to a DirectInputDevice8 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_APPDATA
- Retrieves the application-defined value associated with an in-game action, as a DIPROPPOINTER.
- DIPROP_AUTOCENTER
- Specifies whether device objects are self-centering. See DirectInputDevice8.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 DirectInputDevice8.GetDeviceData method before data is lost. You can set this value to 0 to indicate that the application does not read buffered data from the device.
- DIPROP_CPOINTS
- Retrieves calibration points used to adjust incoming raw data as a DIPROPCPOINTS structure.
- 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. 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 gain value that is applied to all effects created on the device. The value is an integer in the range from 0 through 10,000, specifying the amount by which effect magnitudes should be scaled for the device. For example, a value of 10,000 indicates that you should take all effect magnitudes at face value. A value of 9,000 indicates that you should reduce all effect magnitudes to 90% of their nominal magnitudes.
- 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 device must be acquired in exclusive mode. If it is not, the method fails with a return value of DIERR_NOTEXCLUSIVEACQUIRED.
The lData member contains a value in the range 0 to 100, indicating the percentage of device memory in use.
- DIPROP_GETPORTDISPLAYNAME
- Retrieves the human-readable display name of the port to which this device is connected. Not generally used by applications. If no friendly name is returned, the method returns S_FALSE.
- DIPROP_GRANULARITY
- Retrieves the input granularity. Granularity represents the smallest distance in which the object reports movement. Most axis objects have a granularity of 1, whcih means that all values are possible. Some axes may have a larger granularity. For example, the wheel axis on a mouse might have a granularity of 20, meaning that all reported changes in position are multiples of 20. 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 DirectInputDevice8.SetProperty method.
- DIPROP_INSTANCENAME
- Retrieves the friendly instance name of the device. For more information, see DirectInputDevice8.SetProperty.
- DIPROP_JOYSTICKID
- Retrieves the instance number of a joystick. This property is not implemented for the mouse or keyboard.
- DIPROP_LOGICALRANGE
- Retrieves the range of the raw data returned for axes on a HID. Devices can return negative values.
- DIPROP_PHYSICALRANGE
- Retrieves the range of data for axes as suggested by the manufacturer of a HID. Values can be negative. Normally DirectInput® returns values from 0 through 0xFFFF, but the range can be made to conform to the manufacturer's suggested range by using DIPROP_RANGE.
- DIPROP_PRODUCTNAME
- Retrieves the friendly product name of the device. For more information, see DirectInputDevice8.SetProperty.
- 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 DirectInputDevice8.SetProperty method.
- DIPROP_SATURATION
- Retrieves a value for the 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).
- DIPROP_SCANCODE
- Retrieves the scan code for a keyboard key, as a DIPROPLONG. If successful, DI_OK is returned. DIERR_GENERIC is returned if the property cannot resolve specialized keys on USB keyboards because they do not exist in scan code form. For all other failures, DIERR_INVALIDPARAM is returned.
- DIPROP_USERNAME
- Retrieves the user name for a user currently assigned to a device, as a DIPROPSTRING. User names are set by calling DirectInputDevice8.SetActionMap. If no user name is set, the method returns S_FALSE.
propertyInfo
A DIPROPLONG type to receive a single value, a DIPROPRANGE type to receive a pair of values, or a DIPROPSTRING to receive a string for the property. The lObj, lHow, and lSize members of the 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.
See Also
DirectInputDevice8.SetProperty