HGE Input Event structure

Input Event structure is used with Input_GetEvent function to receive buffered input events:

struct hgeInputEvent
{
  int    type;
  int    key;
  int    flags;
  int    chr;
  int    wheel;
  float  x;
  float  y;
};

Members

type
Type of the event, could be one of these:
INPUT_KEYDOWN - a keyboard key was pressed down
INPUT_KEYUP - a keyboard key was released
INPUT_MBUTTONDOWN - a mouse button was pressed down
INPUT_MBUTTONUP - a mouse button was released
INPUT_MOUSEMOVE - mouse was moved
INPUT_MOUSEWHEEL - mouse wheel was rotated
key
The key code. Is valid only for INPUT_KEYDOWN, INPUT_KEYUP, INPUT_MBUTTONDOWN and INPUT_MBUTTONUP events.
flags
Bitwise or (|) combination of the following constants, specifying the event context: HGEINP_SHIFT - one of the Shift keys is pressed down
HGEINP_CTRL - one of the Ctrl keys is pressed down
HGEINP_ALT - one of the Alt keys is pressed down
HGEINP_CAPSLOCK - Caps Lock is toggled on
HGEINP_NUMLOCK - Num Lock is toggled on
HGEINP_SCROLLLOCK - Scroll Lock is toggled on
HGEINP_REPEAT - for INPUT_KEYDOWN: the event is generated due to autorepeat feature; for INPUT_MBUTTONDOWN: the event is double click
chr
The character code, cosidering the current keyboard states and input locale. Is valid only for INPUT_KEYDOWN and INPUT_KEYUP events.
wheel
The number of notches the mouse wheel was rotated through. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. Is valid only for INPUT_MOUSEWHEEL event.
x
Mouse cursor X-position.
y
Mouse cursor Y-position.

Requirements

Header: hge.h

See also

Input_GetEvent, Key codes