DirectX SDK

DirectInputDeviceInstance.GetDevType

The DirectInputDeviceInstance.GetDevType method retrieves the device type and subtype.

object.GetDevType() As Long

Parameters

object
Object expression that resolves to a DirectInputDeviceInstance object.

Return Values

The method returns a device type specifier. This value is a combination of a type (in the least significant byte) and subtype (in the next most significant byte), optionally combined using Or with DIDEVTYPE_HID, which specifies a Human Interface Device. The following constants are from the CONST_DIDEVICETYPE enumeration.

Device Types
DIDEVTYPE_MOUSE
A mouse or mouse-like device (such as a trackball).
DIDEVTYPE_KEYBOARD
A keyboard or keyboard-like device.
DIDEVTYPE_JOYSTICK
A joystick or similar device, such as a steering wheel.
DIDEVTYPE_DEVICE
A device that does not fall into the previous categories.
Mouse subtypes
DIDEVTYPEMOUSE_UNKNOWN
The subtype could not be determined.
DIDEVTYPEMOUSE_TRADITIONAL
The device is a traditional mouse.
DIDEVTYPEMOUSE_FINGERSTICK
The device is a fingerstick.
DIDEVTYPEMOUSE_TOUCHPAD
The device is a touchpad.
DIDEVTYPEMOUSE_TRACKBALL
The device is a trackball.
Keyboard subtypes
DIDEVTYPEKEYBOARD_UNKNOWN
The subtype could not be determined.
DIDEVTYPEKEYBOARD_PCXT
IBM PC/XT 83-key keyboard.
DIDEVTYPEKEYBOARD_OLIVETTI
Olivetti 102-key keyboard.
DIDEVTYPEKEYBOARD_PCAT
IBM PC/AT 84-key keyboard.
DIDEVTYPEKEYBOARD_PCENH
IBM PC Enhanced 101/102-key or Microsoft Natural® keyboard.
DIDEVTYPEKEYBOARD_NOKIA1050
Nokia 1050 keyboard.
DIDEVTYPEKEYBOARD_NOKIA9140
Nokia 9140 keyboard.
DIDEVTYPEKEYBOARD_NEC98
Japanese NEC PC98 keyboard.
DIDEVTYPEKEYBOARD_NEC98LAPTOP
Japanese NEC PC98 laptop keyboard.
DIDEVTYPEKEYBOARD_NEC98106
Japanese NEC PC98 106-key keyboard.
DIDEVTYPEKEYBOARD_JAPAN106
Japanese 106-key keyboard.
DIDEVTYPEKEYBOARD_JAPANAX
Japanese AX keyboard.
DIDEVTYPEKEYBOARD_J3100
Japanese J3100 keyboard.
Joystick Subtypes
DIDEVTYPEJOYSTICK_UNKNOWN
The subtype could not be determined.
DIDEVTYPEJOYSTICK_TRADITIONAL
A traditional joystick.
DIDEVTYPEJOYSTICK_FLIGHTSTICK
A joystick optimized for flight simulation.
DIDEVTYPEJOYSTICK_GAMEPAD
A device whose primary purpose is to provide button input.
DIDEVTYPEJOYSTICK_RUDDER
A device for yaw control.
DIDEVTYPEJOYSTICK_WHEEL
A steering wheel.
DIDEVTYPEJOYSTICK_HEADTRACKER
A device that tracks the movement of the user's head.
Human Interface Device
DIDEVTYPE_HID
The device uses the Human Interface Device (HID) protocol.

Error Codes

If the method fails, an error is raised and Err.Number will be set.

Remarks

To look for a particular subtype of device such as a wheel, you should check both the type and the subtype.