INPUT structure

Used by SendInput to store information for synthesizing input events such as keystrokes, mouse movement, and mouse clicks.

Syntax

typedef struct tagINPUT {
  DWORD type;
  union {
    MOUSEINPUT    mi;
    KEYBDINPUT    ki;
    HARDWAREINPUT hi;
  } DUMMYUNIONNAME;
} INPUT, *PINPUT, *LPINPUT;

Members

type

Type: DWORD

The type of the input event. This member can be one of the following values.

Value Meaning
INPUT_MOUSE
0
The event is a mouse event. Use the mi structure of the union.
INPUT_KEYBOARD
1
The event is a keyboard event. Use the ki structure of the union.
INPUT_HARDWARE
2
The event is a hardware event. Use the hi structure of the union.

DUMMYUNIONNAME

DUMMYUNIONNAME.mi

Type: MOUSEINPUT

The information about a simulated mouse event.

DUMMYUNIONNAME.ki

Type: KEYBDINPUT

The information about a simulated keyboard event.

DUMMYUNIONNAME.hi

Type: HARDWAREINPUT

The information about a simulated hardware event.

Remarks

INPUT_KEYBOARD supports nonkeyboard input methods, such as handwriting recognition or voice recognition, as if it were text input by using the KEYEVENTF_UNICODE flag. For more information, see the remarks section of KEYBDINPUT.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header winuser.h (include Windows.h)

See Also

Conceptual

GetMessageExtraInfo

HARDWAREINPUT

KEYBDINPUT

Keyboard Input

MOUSEINPUT

Reference

SendInput

keybd_event

mouse_event