Skip to content

Keyboard and Mouse

Nick Tracy edited this page Jul 18, 2026 · 1 revision

Keyboard and Mouse

Keyboard (works almost everywhere)

Newer examples read:

  • Arrow keys — move a highlight
  • Enter — activate
  • Space — often an alternate activate key
  • Letters — game controls (WASD) or menu shortcuts (W/S, J/K on the ESP dashboard)

If arrows do nothing:

  1. Click inside the terminal window so it has focus.
  2. Confirm you are not in a mode where the terminal captures arrows for scrolling.
  3. Try Enter/Space — some demos accept those even when arrows fail.

Mouse (optional)

ANSITerm can listen for SGR mouse reports (a common xterm feature). When it works, clicking a drawn button feels natural.

When mouse usually works

  • Some network/telnet clients
  • Full-featured terminal emulators with mouse reporting enabled

When mouse usually does not work

  • PuTTY connected to a serial COM port
  • Many simple serial monitors

That is why Examples such as Basic, Advanced, Buttons, and ANS files also accept keyboard activation.

Releases vs presses

A full mouse click sends a press and a release. ANSITerm treats them separately so a single click does not fire your action twice. Sketches typically react to press only.

Practical advice

Goal Do this
Reliable demos for workshops Design for keyboard first
Kiosk / desktop telnet UI Enable mouse in the client and test clicks
Games Turn mouse reporting off if unused (Graphic)

Clone this wiki locally