# jon5307/precisioninputtest architecture

> Architecture diagram of the GitHub repository jon5307/precisioninputtest, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jon5307/precisioninputtest
- Repository: https://github.com/jon5307/precisioninputtest

## Overview

This small console application tests high-frequency keyboard input: the program starts a polling worker, then reports queued key events with timestamps relative to a shared timer. The worker samples the Windows key-state API and enqueues key-down events; the main loop also checks Escape and stops the worker. The excerpts show these runtime interactions directly.

Main entry points: [`PrecisionInputTest/Program.cs`](https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Program.cs) (Console loop), [`PrecisionInputTest/Poll.cs`](https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Poll.cs) (Input poller)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_program["Console loop<br/>[Program.cs]"]
node_poll["Input poller<br/>[Poll.cs]"]
node_queue["Event queue<br/>[Poll.cs]"]
node_timer["Shared timer<br/>[Program.cs]"]
node_winapi["Windows key API"]

node_user -->|"runs"| node_program
node_program -->|"starts"| node_timer
node_program -->|"starts"| node_poll
node_program -->|"passes"| node_timer
node_poll -->|"polls key"| node_winapi
node_program -->|"checks Escape"| node_winapi
node_poll -->|"timestamps events"| node_timer
node_poll -->|"enqueues events"| node_queue
node_program -->|"dequeues events"| node_queue
node_program -->|"stops"| node_poll

click node_program "https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Program.cs"
click node_poll "https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Poll.cs"
click node_queue "https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Poll.cs"
click node_timer "https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Program.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user toneBlue
class node_program,node_poll,node_timer toneTeal
class node_queue toneRose
class node_winapi toneMint
```

## Components

### Other components

- **User**
- [Console loop](https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Program.cs): `PrecisionInputTest/Program.cs`
- [Input poller](https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Poll.cs): `PrecisionInputTest/Poll.cs`
- [Event queue](https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Poll.cs): `PrecisionInputTest/Poll.cs`
- [Shared timer](https://github.com/jon5307/precisioninputtest/blob/master/PrecisionInputTest/Program.cs): `PrecisionInputTest/Program.cs`
- **Windows key API**

## Connections

- User → Console loop: runs (evidence: `PrecisionInputTest/Program.cs`)
- Console loop → Shared timer: starts (evidence: `PrecisionInputTest/Program.cs`)
- Console loop → Input poller: starts (evidence: `PrecisionInputTest/Program.cs`)
- Console loop → Shared timer: passes (evidence: `PrecisionInputTest/Program.cs`)
- Input poller → Windows key API: polls key (evidence: `PrecisionInputTest/Poll.cs`)
- Console loop → Windows key API: checks Escape (evidence: `PrecisionInputTest/Program.cs`)
- Input poller → Shared timer: timestamps events (evidence: `PrecisionInputTest/Poll.cs`)
- Input poller → Event queue: enqueues events (evidence: `PrecisionInputTest/Poll.cs`)
- Console loop → Event queue: dequeues events (evidence: `PrecisionInputTest/Program.cs`)
- Console loop → Input poller: stops (evidence: `PrecisionInputTest/Program.cs`)
