Vixen
02b45cc4
csharp
public interface IInputSource

Raw input devices and the state of the keyboard and pointer.

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

Remarks

This is the bottom of the input stack, not the top. It reports what the hardware is doing; the action maps, rebinding, dead zones and composite bindings are Vixen.Input's job in Phase 8, and it is built on top of this and the event stream rather than beside them.

Key and button state is here as well as in events because the platform is the only thing that knows the truth after focus is lost. Reconstructing "is W down" from events means reconstructing it wrongly the first time the user alt-tabs mid-stride.

Fields and properties (3)

  • IReadOnlyList<IGamepad> Gamepads

    Every connected gamepad.

  • KeyModifiers Modifiers

    The modifier keys held now.

  • Vector2 PointerPosition

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

Methods (3)

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

    Finds a gamepad by the id its events carry.

  • bool IsKeyDown(Key key)

    Whether a key is held, by physical position.

  • bool IsMouseButtonDown(MouseButton button)

    Whether a mouse button is held.

Used by (7)

  • DesktopInputSourceVixen.Platform.Desktop
  • DesktopPlatformVixen.Platform.Desktop
  • HeadlessInputSourceVixen.Platform.Headless
  • HeadlessLifecycleTestsVixen.Platform.Headless.Tests
  • HeadlessPlatformVixen.Platform.Headless
  • IPlatformVixen.Platform
  • PlatformInputVixen.App.Hosting