Presenter command scheduling

Turning five large buttons into keyboard reports that remain ordered, bounded, and safe across a Bluetooth disconnect.

Source baseline: app 1.0.0 (2) · 14 August 2026

Control boundary

The app does not automate PowerPoint through a network API. It presents itself as a Bluetooth keyboard, so the host needs no companion software and receives the same standard keys as a physical presenter.

UI and lifecycleKotlin, Jetpack Compose, Android foreground service
TransportShared Classic HID / BLE HOGP selection
Command stateConnected or disconnected, with one in-flight command and a bounded queue
Host dependencyThe active presentation application must interpret the standard keys

Five semantic commands

ActionHID key sequence
NextPage Down
PreviousPage Up
Start from beginningF5, then Home
Start from current slideShift + F5
StopEscape

These mappings are kept as semantic commands until dispatch. That separation lets the UI describe presentation intent while the protocol layer owns key usage codes and neutral reports.

Scheduler rules

The scheduler permits input immediately after a usable connection; there is no hidden “armed” state. It serializes one command at a time and caps pending work at 16 entries.

Pressed and neutral reports

Each key command is sent as one burst containing the pressed report and its neutral release. The presenter therefore disables the generic release watchdog: adding another neutral report would increase traffic without closing a real hold window.

Stale commands are more dangerous than dropped commands. During a presentation, replaying an old Next after reconnection changes visible content, so the queue favors bounded rejection and generation-scoped dispatch.

The foreground service owns the HID session and participates in the same signed-sibling handoff as the Keyboard and Mouse apps. Shutdown returns neutral state before disconnecting and unregistering.

Verification and known limits

Tests cover key mappings, queue capacity, opposite-command cancellation, start and stop barriers, battery policy, session routing, lifecycle recovery, and accessibility hit regions.