Key Input Demo

key-input-demo combines immediate key handling with a horizontally scrolling retained buffer. Each pressed key is stamped into the field as a colored block, so the demo makes keyboard input, buffer updates, and continuous motion visible at the same time.

Use This Demo When You Need…

  • A support example for Input::Mode::Key and immediate key handling.

  • A visual reference for scrolling content inside a retained buffer.

  • A small demo that mixes user input with animation in the same screen.

Run the Demo

Start the demo from the build directory:

$ ./cmake-build-debug/demo-apps/key-input-demo

Press any key to stamp a block into the field. Press Esc to quit.

Captured Output (80x25)

  Key Input Demo                              horizontal RemappedBuffer 250x30

   [A]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [esc] quit Press any other key to stamp a colored key block into the scrolling

Features Demonstrated

  • Input::Mode::Key with immediate, non-line-buffered key handling.

  • Key::toDisplayText() for user-facing key labels.

  • A horizontally moving retained buffer used as a simple scrolling field.

  • Mixed animation and event-driven drawing on the same screen.

Relevant Source Files

If you want to explore the implementation, start with demo/key-input-demo/src/KeyInputDemoApp.cpp.

This file contains the scrolling buffer setup, key stamping logic, and footer/help text generation.