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.

Focus​Gained


public static readonly attribute FocusGained → (InputEvent)

The input event value for FocusGained.

Focus​Lost


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

Character​Typed


public static method CharacterTyped → (3)

character in : char

The Character value.

mouseCursor in : Vec2I

The MouseCursor value.

modifiers opt : InputModifiers = InputModifiers.None

The mouse modifiers.

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.

Mouse​Enter


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.

Mouse​Leave


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?

Has​Any


[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?

Has​None


[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?

Is​Clicked

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?

Is​Pressed

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?

Is​Pressed​Or​Repeated


[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?

Is​Released

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?

Is​Repeated


[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?

Is​Typed


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

Has​Alt


public attribute HasAlt → (get)

value : bool

true if the modifier is present, false if not.

Is the InputModifiers.Alt modifier present?

Has​Control


public attribute HasControl → (get)

value : bool

true if the modifier is present, false if not.

Is the InputModifiers.Control modifier present?

Has​Shift


public attribute HasShift → (get)

value : bool

true if the modifier is present, false if not.

Is the InputModifiers.Shift modifier present?

Is​Keyboard


public attribute IsKeyboard → (get)

value : bool

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

Is this a keyboard event?

Is​Mouse


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.

Mouse​Move


public readonly attribute MouseMove → (Vec2I)

Relative movement of the mouse.

Mouse​Wheel


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

Tick​Count


public readonly attribute TickCount → (int32)

Timestamp of this input event.

Type


public readonly attribute Type → (InputEventType)

The input event type.