InputEvent

Description

[ShutdownSurvive]
sealed class Tinman.Engine.Application.InputEvent

Wraps a single input event.

Public / Constants

Closing


public static readonly attribute Closing → (InputEvent)

The input event value for InputEventType.Closing.

FocusGained


public static readonly attribute FocusGained → (InputEvent)

The input event value for FocusGained.

FocusLost


public static readonly attribute FocusLost → (InputEvent)

The input event for InputEventType.FocusLost.

None


public static readonly attribute None → (InputEvent)

The input event value for InputEventType.None

Public / Constructors

CharacterTyped


public static method CharacterTyped → (2)

character in : char

The Character value.

mouseCursor in : Vec2I

The MouseCursor value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.Character.

Clicked

2 overloads


public static method Clicked1 → (3)

key in : KeyboardKey

The Key value.

mouseCursor in : Vec2I

The MouseCursor value.

modifiers in : InputModifiers

The Modifiers value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.Clicked.


public static method Clicked2 → (3)

button in : MouseButton

The Button value.

mouseCursor in : Vec2I

The MouseCursor value.

modifiers in : InputModifiers

The Modifiers value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.Clicked.

Mouse


public static method Mouse → (4)

mouseCursor in : Vec2I

The MouseCursor value.

mouseMove in : Vec2I

The MouseMove value.

mouseWheel in : int32

The MouseWheel value.

modifiers in : InputModifiers

The Modifiers value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.MouseMove.

MouseEnter


public static method MouseEnter → (1)

mouseCursor in : Vec2I

The MouseCursor value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.MouseEnter.

MouseLeave


public static method MouseLeave → (1)

mouseCursor in : Vec2I

The MouseCursor value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.MouseLeave.

Pressed

2 overloads


public static method Pressed1 → (3)

key in : KeyboardKey

The Key value.

mouseCursor in : Vec2I

The MouseCursor value.

modifiers in : InputModifiers

The Modifiers value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.Pressed.


public static method Pressed2 → (3)

button in : MouseButton

The Button value.

mouseCursor in : Vec2I

The MouseCursor value.

modifiers in : InputModifiers

The Modifiers value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.Pressed.

Released

2 overloads


public static method Released1 → (3)

key in : KeyboardKey

The Key value.

mouseCursor in : Vec2I

The MouseCursor value.

modifiers in : InputModifiers

The Modifiers value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.Released.


public static method Released2 → (3)

button in : MouseButton

The Button value.

mouseCursor in : Vec2I

The MouseCursor value.

modifiers in : InputModifiers

The Modifiers value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.Released.

Repeated


public static method Repeated → (3)

key in : KeyboardKey

The Key value.

mouseCursor in : Vec2I

The MouseCursor value.

modifiers in : InputModifiers

The Modifiers value.

returns → InputEvent

The input event.

Creates a new instance of InputEvent for InputEventType.Repeated.

Public / Methods

Has


[Pure]
public method Has → (1)

modifiers in : InputModifiers

The modifiers to check.

returns → bool

true if this input event shares all modifiers in, false if not.

Does this input event have all the given modifiers?

HasAny


[Pure]
public method HasAny → (1)

modifiers in : InputModifiers

To modifiers to check.

returns → bool

true if this input event shares at least one modifier with modifiers in, false if not.

Does this input event have at least one of the given modifiers?

HasNone


[Pure]
public method HasNone → (1)

modifiers in : InputModifiers

To modifiers to check.

returns → bool

true if this input event has none of the given modifiers in, false if it shares at least one.

Does this input event have none of the given modifiers?

IsClicked

2 overloads


[Pure]
public method IsClicked1 → (2)

key in : KeyboardKey

The keyboard key.

modifiers opt : InputModifiers = InputModifiers.None

The expected input modifiers.

returns → bool

true if the key has been clicked, false if not.

Has the given keyboard key been clicked?


[Pure]
public method IsClicked2 → (2)

button in : MouseButton

The mouse button.

modifiers opt : InputModifiers = InputModifiers.None

The expected input modifiers.

returns → bool

true if the button has been clicked, false if not.

Has the given mouse button been clicked?

IsPressed

2 overloads


[Pure]
public method IsPressed1 → (1)

key in : KeyboardKey

The keyboard key.

returns → bool

true if the key has been pressed down, false if not.

Has the given keyboard key been pressed down?


[Pure]
public method IsPressed2 → (1)

button in : MouseButton

The mouse button.

returns → bool

true if the button has been pressed down, false if not.

Has the given mouse button been pressed down?

IsPressedOrRepeated


[Pure]
public method IsPressedOrRepeated → (2)

key in : KeyboardKey

The keyboard key.

modifiers opt : InputModifiers = InputModifiers.None

The expected input modifiers.

returns → bool

true if the key has been pressed or repeated, false if not.

Has the given keyboard key been pressed or repeated?

IsReleased

2 overloads


[Pure]
public method IsReleased1 → (1)

key in : KeyboardKey

The keyboard key.

returns → bool

true if the key has been released, false if not.

Has the given keyboard key been released?


[Pure]
public method IsReleased2 → (1)

button in : MouseButton

The mouse button.

returns → bool

true if the button has been released, false if not.

Has the given mouse button been released?

IsRepeated


[Pure]
public method IsRepeated → (2)

key in : KeyboardKey

The keyboard key.

modifiers opt : InputModifiers = InputModifiers.None

The expected input modifiers.

returns → bool

true if the key has been repeated, false if not.

Has the given keyboard key been repeated?

IsTyped


[Pure]
public method IsTyped → (1)

in : char

The character.

returns → bool

true if the character has been typed, false if not.

Has the given character been typed in?

Translate

2 overloads


[Pure]
public method Translate1 → (1)

in : Vec2I

The translation vector.

returns → InputEvent

The resulting input event.

Translates the mouse cursor coordinates by the given amount.


[Pure]
public method Translate2 → (2)

in : int32

X-component of translation vector.

in : int32

Y-component of translation vector.

returns → InputEvent

The resulting input event.

Translates the mouse cursor coordinates by the given amount.

Public / Attributes

Button


public readonly attribute Button → (MouseButton)

The mouse button that has been pressed or released.

Character


public readonly attribute Character → (char)

The character that has been typed in.

HasAlt


public attribute HasAlt → (get)

value : bool

true if the modifier is present, false if not.

Is the InputModifiers.Alt modifier present?

HasControl


public attribute HasControl → (get)

value : bool

true if the modifier is present, false if not.

Is the InputModifiers.Control modifier present?

HasShift


public attribute HasShift → (get)

value : bool

true if the modifier is present, false if not.

Is the InputModifiers.Shift modifier present?

IsKeyboard


public attribute IsKeyboard → (get)

value : bool

true if this is a keyboard event, false if not.

Is this a keyboard event?

IsMouse


public attribute IsMouse → (get)

value : bool

true if this is a mouse event, false if not.

Is this a mouse event?

Key


public readonly attribute Key → (KeyboardKey)

The keyboard key that has been pressed or released.

Modifiers


public readonly attribute Modifiers → (InputModifiers)

The keyboard modifiers.

MouseCursor


public readonly attribute MouseCursor → (Vec2I)

Location of the mouse cursor in the application windows client area.

MouseMove


public readonly attribute MouseMove → (Vec2I)

Relative movement of the mouse.

MouseWheel


public readonly attribute MouseWheel → (int32)

Movement of the mouse wheel.

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).

TickCount


public readonly attribute TickCount → (int32)

Timestamp of this input event.

Type


public readonly attribute Type → (InputEventType)

The input event type.