INPUT_TYPE Structure

Type INPUT_TYPE
  dwType As Long
  xi(0 To 23) As Byte
End Type

Description & Usage

The INPUT_TYPE structure holds information about an input event to be placed in the input stream. The input can be from the keyboard, the mouse, or some other hardware. Essentially, this structure merely identifies the source of an input event.

Visual Basic-Specific Issues

Officially, this structure is called INPUT. However, that violates the case-sensitive name spacing of Visual Basic because Visual Basic contains an intrinsic Input command. The Windows API Guide calls this structure INPUT_TYPE to avoid the naming collision.

Also, this structure does not officially have a data member called xi. That space in the structure is actually a "union" of three members: mi, ki, and hi, all of which occupy the same physical space in the structure and of which only one can be used at any one time. Each of those actual members are the contents of one of the three structures discussed below physically embedded in the structure. Because, unlike C++, Visual Basic does not have any analogous construct, a workaround must be reached. Therefore, as far as Visual Basic is concerned, a byte array called xi occupies that space, into which the contents of one of the possible structures must be copied. See the example for SendInput for a demonstration.

Data Members

dwType
Exactly one of the following flags specifying which type of input event this structure contains:
INPUT_MOUSE
The structure identifies a mouse input event.
INPUT_KEYBOARD
The structure identifies a keyboard input event.
INPUT_HARDWARE
Windows 98: The structure identifies some other hardware input event.
xi
Buffer which holds the contents of a data structure, depending on the value of dwType. A MOUSEINPUT structure is used for mouse events, a KEYBDINPUT structure for keyboard events, and a HARDWAREINPUT structure for other hardware events. (See the SendInput example for a demonstration of using this parameter.)

Constant Definitions

Const INPUT_MOUSE = 0
Const INPUT_KEYBOARD = 1
Const INPUT_HARDWARE = 2

Used By

SendInput

Go back to the alphabetical Structure listing.
Go back to the Reference section index.


Last Modified: October 9, 1999
This page is copyright © 1999 Paul Kuliniewicz. Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/i/input_type.html