Key Input Demo
key-input-demo visualizes detected key presses inside a horizontally
scrolling RemappedBuffer. Every key press becomes a colored stamp in the
field, so the demo doubles as both an input test and a compact illustration
of retained buffer content that moves independently from new writes.
It is a helpful example when you want to combine immediate key handling with buffer-based animation.
Run the Demo
Start the demo from the build directory:
$ ./cmake-build-debug/demo-apps/key-input-demo
Press any key to stamp it into the scrolling field. Press Esc to quit.
ANSI Output Example
The following capture shows the scrolling field after one A key press:
Key Input Demo horizontal RemappedBuffer 250x30 ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ [A] ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ [esc] quit Press any other key to stamp a colored key block into the scrolling
Features Shown
This demo brings several interactive building blocks together:
Input::Mode::Keywith immediate key handling.Key::toDisplayText()for user-facing labels.Horizontal
RemappedBufferscrolling.Mixed animation and event-driven drawing in one retained buffer.
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 the footer/help text generation.