PyINPUT_RECORD Object
Interface to the INPUT_RECORD struct used with console IO functions. Create using
PyINPUT_RECORDType(EventType)
Comments
Only attributes that apply to each particular EventType can be accessed:
KEY_EVENT: KeyDown, RepeatCount, VirtualKeyCode, VirtualScanCode, ControlKeyState
MOUSE_EVENT: MousePosition, ButtonState, ControlKeyState, EventFlags
WINDOW_BUFFER_SIZE_EVENT: Size
FOCUS_EVENT: SetFocus
MENU_EVENT: CommandId
Properties
- int EventType
- One of KEY_EVENT, MOUSE_EVENT, WINDOW_BUFFER_SIZE_EVENT, MENU_EVENT, FOCUS_EVENT. Cannot be
changed after object is created
- boolean KeyDown
- True for a key press, False for key release
- int RepeatCount
- Nbr of repeats generated (key was held down if >1)
- int VirtualKeyCode
- Device-independent key code, win32con.VK_*
- int VirtualScanCode
- Device-dependent scan code generated by keyboard
- PyUnicode
Char
- Single unicode character generated by the keypress
- int ControlKeyState
- State of modifier keys, combination of CAPSLOCK_ON, ENHANCED_KEY, LEFT_ALT_PRESSED,
LEFT_CTRL_PRESSED, NUMLOCK_ON, RIGHT_ALT_PRESSED, RIGHT_CTRL_PRESSED, SCROLLLOCK_ON, SHIFT_PRESSED
- int ButtonState
- Bitmask representing which mouse buttons were pressed.
- int EventFlags
- DOUBLE_CLICK, MOUSE_MOVED or MOUSE_WHEELED, or 0. If 0, indicates a mouse button press
- PyCOORD MousePosition
- Position in character coordinates
- PyCOORD Size
- New size of screen buffer in character rows/columns
- boolean SetFocus
- Reserved - Used only with type FOCUS_EVENT. This event is Reserved, and should be
ignored.
- int CommandId
- Used only with event type MENU_EVENT, which is reserved and should not be used