ConsoleInputFlags

When capturing input, what events are you interested in?

Note: these flags can be OR'd together to select more than one option at a time.

Ctrl+C and other keyboard input is always captured, though it may be line buffered if you don't use raw. The rationale for that is to ensure the Terminal destructor has a chance to run, since the terminal is a shared resource and should be put back before the program terminates.

Values

ValueMeaning
raw0

raw input returns keystrokes immediately, without line buffering

echo1

do you want to automatically echo input back to the user?

mouse2

capture mouse events

paste4

capture paste events (note: without this, paste can come through as keystrokes)

size8

window resize events

releasedKeys64

key release events. Not reliable on Posix.

allInputEvents8 | 4 | 2

subscribe to all input events. Note: in previous versions, this also returned release events. It no longer does, use allInputEventsWithRelease if you want them.

allInputEventsWithReleaseallInputEvents | releasedKeys

subscribe to all input events, including (unreliable on Posix) key release events.

noEolWrap128
selectiveMouse256

Uses arsd terminal emulator's proprietary extension to select mouse input only for special cases, intended to enhance getline while keeping default terminal mouse behavior in other places. If it is set, it overrides mouse event flag. If not using the arsd terminal emulator, this will disable application mouse input.

Meta