Wraps a single input event.
sealed class
|
InputEvent
|
implements
|
IEquatable<InputEvent>
|
||
IInputState
|
The input event value for Closing.
public
static
readonly
field
|
Closing
|
||
type
|
InputEvent
|
The input event value for FocusGained.
public
static
readonly
field
|
FocusGained
|
||
type
|
InputEvent
|
The input event for FocusLost.
public
static
readonly
field
|
FocusLost
|
||
type
|
InputEvent
|
The input event value for None
public
static
readonly
field
|
None
|
||
type
|
InputEvent
|
The mouse button that has been pressed or released.
public
readonly
field
|
Button
|
||
type
|
MouseButton
|
See also:
InputEventType.PressedThe character that has been typed in.
public
readonly
field
|
Character
|
||
type
|
char
|
See also:
InputEventType.CharacterIs the Alt modifier present?
public
property
|
HasAlt
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
modifier
is
present,
false
if
not. |
See also:
ModifiersIs the Control modifier present?
public
property
|
HasControl
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
modifier
is
present,
false
if
not. |
See also:
ModifiersIs the Shift modifier present?
public
property
|
HasShift
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
modifier
is
present,
false
if
not. |
See also:
ModifiersIs this a keyboard event?
public
property
|
IsKeyboard
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
is
a
keyboard
event,
false
if
not. |
See also:
InputEventType.CharacterIs this a mouse event?
public
property
|
IsMouse
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
is
a
mouse
event,
false
if
not. |
See also:
InputEventType.ClickedThe keyboard key that has been pressed or released.
public
readonly
field
|
Key
|
||
type
|
KeyboardKey
|
See also:
InputEventType.PressedThe keyboard modifiers.
public
readonly
field
|
Modifiers
|
||
type
|
InputModifiers
|
See also:
InputEventType.ClickedLocation of the mouse cursor in the application windows client area.
public
readonly
field
|
MouseCursor
|
||
type
|
Vec2I
|
See also:
InputEventType.CharacterRelative movement of the mouse.
public
readonly
field
|
MouseMove
|
||
type
|
Vec2I
|
See also:
InputEventType.MouseMoveMovement of the mouse wheel.
public
readonly
field
|
MouseWheel
|
||
type
|
int32
|
Remarks:
A positive value indicates that the wheel has rotated forward (away from user), a negative value indicates a backwards rotation (towards user).
Each mouse wheel tick is represented as +1 resp. -1 (there is no implicit multiplier).
See also:
InputEventType.MouseMoveTimestamp of this input event.
public
readonly
field
|
TickCount
|
||
type
|
int32
|
See also:
LowLevel.TickCountThe input event type.
public
readonly
field
|
Type
|
||
type
|
InputEventType
|
Creates a new instance of InputEvent for Character.
public
static
method
|
CharacterTyped
(char character,
Vec2I mouseCursor)
|
||
type
|
InputEvent
|
||
params
|
character
|
The Character value. | |
mouseCursor
|
The MouseCursor value. | ||
returns
|
The input event. |
Creates a new instance of InputEvent for Clicked.
public
static
method
|
Clicked
(KeyboardKey key,
Vec2I mouseCursor,
InputModifiers modifiers)
|
||
type
|
InputEvent
|
||
params
|
key
|
The Key value. | |
mouseCursor
|
The MouseCursor value. | ||
modifiers
|
The Modifiers value. | ||
returns
|
The input event. |
Creates a new instance of InputEvent for Clicked.
public
static
method
|
Clicked
(MouseButton button,
Vec2I mouseCursor,
InputModifiers modifiers)
|
||
type
|
InputEvent
|
||
params
|
button
|
The Button value. | |
mouseCursor
|
The MouseCursor value. | ||
modifiers
|
The Modifiers value. | ||
returns
|
The input event. |
Creates a new instance of InputEvent for MouseMove.
public
static
method
|
Mouse
(Vec2I mouseCursor,
Vec2I mouseMove,
int32 mouseWheel,
InputModifiers modifiers)
|
||
type
|
InputEvent
|
||
params
|
mouseCursor
|
The MouseCursor value. | |
mouseMove
|
The MouseMove value. | ||
mouseWheel
|
The MouseWheel value. | ||
modifiers
|
The Modifiers value. | ||
returns
|
The input event. |
Creates a new instance of InputEvent for MouseEnter.
public
static
method
|
MouseEnter
(Vec2I mouseCursor)
|
||
type
|
InputEvent
|
||
params
|
mouseCursor
|
The MouseCursor value. | |
returns
|
The input event. |
Creates a new instance of InputEvent for MouseLeave.
public
static
method
|
MouseLeave
(Vec2I mouseCursor)
|
||
type
|
InputEvent
|
||
params
|
mouseCursor
|
The MouseCursor value. | |
returns
|
The input event. |
Creates a new instance of InputEvent for Pressed.
public
static
method
|
Pressed
(KeyboardKey key,
Vec2I mouseCursor,
InputModifiers modifiers)
|
||
type
|
InputEvent
|
||
params
|
key
|
The Key value. | |
mouseCursor
|
The MouseCursor value. | ||
modifiers
|
The Modifiers value. | ||
returns
|
The input event. |
Creates a new instance of InputEvent for Pressed.
public
static
method
|
Pressed
(MouseButton button,
Vec2I mouseCursor,
InputModifiers modifiers)
|
||
type
|
InputEvent
|
||
params
|
button
|
The Button value. | |
mouseCursor
|
The MouseCursor value. | ||
modifiers
|
The Modifiers value. | ||
returns
|
The input event. |
Creates a new instance of InputEvent for Released.
public
static
method
|
Released
(KeyboardKey key,
Vec2I mouseCursor,
InputModifiers modifiers)
|
||
type
|
InputEvent
|
||
params
|
key
|
The Key value. | |
mouseCursor
|
The MouseCursor value. | ||
modifiers
|
The Modifiers value. | ||
returns
|
The input event. |
Creates a new instance of InputEvent for Released.
public
static
method
|
Released
(MouseButton button,
Vec2I mouseCursor,
InputModifiers modifiers)
|
||
type
|
InputEvent
|
||
params
|
button
|
The Button value. | |
mouseCursor
|
The MouseCursor value. | ||
modifiers
|
The Modifiers value. | ||
returns
|
The input event. |
Compares this object with the given one.
[Pure]
|
||||
public
method
|
Equals
(InputEvent other)
|
|||
type
|
bool
|
|||
params
|
other
|
The object to compare to. | ||
returns
|
true
if
this
object
is
equal
to
other,
false
if
not.
|
|||
implements
|
IEquatable.Equals
|
Does this input event have all the given modifiers?
[Pure]
|
||||
public
method
|
Has
(InputModifiers modifiers)
|
|||
type
|
bool
|
|||
params
|
modifiers
|
The modifiers to check. | ||
returns
|
true
if
this
input
event
shares
all
modifiers,
false
if
not.
|
Does this input event have at least one of the given modifiers?
[Pure]
|
||||
public
method
|
HasAny
(InputModifiers modifiers)
|
|||
type
|
bool
|
|||
params
|
modifiers
|
To modifiers to check. | ||
returns
|
true
if
this
input
event
shares
at
least
one
modifier
with
modifiers,
false
if
not.
|
Does this input event have none of the given modifiers?
[Pure]
|
||||
public
method
|
HasNone
(InputModifiers modifiers)
|
|||
type
|
bool
|
|||
params
|
modifiers
|
To modifiers to check. | ||
returns
|
true
if
this
input
event
has
none
of
the
given
modifiers,
false
if
it
shares
at
least
one.
|
Has the given keyboard key been clicked?
[Pure]
|
||||
public
method
|
IsClicked
(KeyboardKey key,
InputModifiers modifiers = InputModifiers.None)
|
|||
type
|
bool
|
|||
params
|
key
|
The keyboard key. | ||
modifiers
|
The expected input modifiers. Defaults to None. | |||
returns
|
true
if
the
key
has
been
clicked,
false
if
not. |
See also:
InputEventType.ClickedHas the given mouse button been clicked?
[Pure]
|
||||
public
method
|
IsClicked
(MouseButton button,
InputModifiers modifiers = InputModifiers.None)
|
|||
type
|
bool
|
|||
params
|
button
|
The mouse button. | ||
modifiers
|
The expected input modifiers. Defaults to None. | |||
returns
|
true
if
the
button
has
been
clicked,
false
if
not. |
See also:
InputEventType.ClickedIs the given keyboard key pressed down?
[Pure]
|
||||
public
method
|
IsDown
(KeyboardKey key)
|
|||
type
|
bool
|
|||
params
|
key
|
The keyboard key. | ||
returns
|
true
if
the
key
is
pressed
down,
false
if
not. |
|||
implements
|
IInputState.IsDown
|
Is the given mouse button pressed down?
[Pure]
|
||||
public
method
|
IsDown
(MouseButton button)
|
|||
type
|
bool
|
|||
params
|
button
|
The mouse button. | ||
returns
|
true
if
the
button
is
pressed
down,
false
if
not. |
|||
implements
|
IInputState.IsDown
|
Has the given keyboard key been pressed down?
[Pure]
|
||||
public
method
|
IsPressed
(KeyboardKey key)
|
|||
type
|
bool
|
|||
params
|
key
|
The keyboard key. | ||
returns
|
true
if
the
key
has
been
pressed
down,
false
if
not. |
See also:
InputEventType.PressedHas the given mouse button been pressed down?
[Pure]
|
||||
public
method
|
IsPressed
(MouseButton button)
|
|||
type
|
bool
|
|||
params
|
button
|
The mouse button. | ||
returns
|
true
if
the
button
has
been
pressed
down,
false
if
not. |
See also:
InputEventType.PressedHas the given keyboard key been released?
[Pure]
|
||||
public
method
|
IsReleased
(KeyboardKey key)
|
|||
type
|
bool
|
|||
params
|
key
|
The keyboard key. | ||
returns
|
true
if
the
key
has
been
released,
false
if
not. |
See also:
InputEventType.ReleasedHas the given mouse button been released?
[Pure]
|
||||
public
method
|
IsReleased
(MouseButton button)
|
|||
type
|
bool
|
|||
params
|
button
|
The mouse button. | ||
returns
|
true
if
the
button
has
been
released,
false
if
not. |
See also:
InputEventType.ReleasedHas the given character been typed in?
[Pure]
|
||||
public
method
|
IsTyped
(char c)
|
|||
type
|
bool
|
|||
params
|
c
|
The character. | ||
returns
|
true
if
the
character
has
been
typed,
false
if
not. |
See also:
InputEventType.Character
[Pure]
|
||||
public
override
method
|
ToString
()
|
|||
type
|
string
|
Translates the mouse cursor coordinates by the given amount.
[Pure]
|
||||
public
method
|
Translate
(Vec2I v)
|
|||
type
|
InputEvent
|
|||
params
|
v
|
The translation vector. | ||
returns
|
The resulting input event. |
Translates the mouse cursor coordinates by the given amount.
[Pure]
|
||||
public
method
|
Translate
(int32 x,
int32 y)
|
|||
type
|
InputEvent
|
|||
params
|
x
|
X-component of translation vector. | ||
y
|
Y-component of translation vector. | |||
returns
|
The resulting input event. |