prompt: introduce struct input to hold the context
prompt: expose API to incrementally receive key events

This API will allow to read key combos (issue #272 and issue #67) and
add support for incremental search (issue #5).