Vixen
02b45cc4
csharp
public sealed class HeadlessInputSource

No devices, and keyboard state that never changes.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Key and button state can be set, because otherwise nothing that reads input can be tested without a keyboard attached — and the input layer's held-key handling across focus loss is exactly the sort of thing that needs a test rather than a person.

Fields and properties (3)

  • public IReadOnlyList<IGamepad> Gamepads

    Every connected gamepad.

  • public KeyModifiers Modifiers

    The modifier keys held now.

  • public Vector2 PointerPosition

    Where the pointer is, in desktop coordinates and logical points.

Methods (6)

  • public bool TryGetGamepad(int deviceId, out IGamepad? gamepad)

    Finds a gamepad by the id its events carry.

  • public bool IsKeyDown(Key key)

    Whether a key is held, by physical position.

  • public bool IsMouseButtonDown(MouseButton button)

    Whether a mouse button is held.

  • public void SetKey(Key key, bool down)

    Sets whether a key is held.

  • public void SetMouseButton(MouseButton button, bool down)

    Sets whether a mouse button is held.

  • public void ReleaseAll()

    Releases everything, as a real platform's focus loss effectively does.

Used by (2)

  • HeadlessLifecycleTestsVixen.Platform.Headless.Tests
  • HeadlessPlatformVixen.Platform.Headless