Safe Haskell | None |
---|
- data Key
- data Modifier
- data Button
- data Event
- data Input = Input {
- _eventChannel :: Chan Event
- shutdownInput :: IO ()
- _configRef :: IORef Config
- _inputDebug :: Maybe Handle
- inputForConfig :: Config -> IO Input
Documentation
Representations of non-modifier keys.
- KFun is indexed from 0 to 63. Range of supported FKeys varies by terminal and keyboard.
- KUpLeft, KUpRight, KDownLeft, KDownRight, KCenter support varies by terminal and keyboard.
- Actually, support for most of these but KEsc, KChar, KBS, and KEnter vary by terminal and keyboard.
Modifier keys. Key codes are interpreted such that users are more likely to
have Meta than Alt; for instance on the PC Linux console, MMeta
will
generally correspond to the physical Alt key.
Mouse buttons.
todo not supported.
Events.
EvKey Key [Modifier] | |
EvMouse Int Int Button [Modifier] | todo mouse events are not supported |
EvResize Int Int | if read from |
Input | |
|
inputForConfig :: Config -> IO InputSource
Set up the terminal with file descriptor inputFd
for input. Returns a Input
.
The table used to determine the Events
to produce for the input bytes comes from
classifyMapForTerm
. Which is then overridden by the the applicable entries from
inputMap
.
The terminal device is configured with the attributes:
- IXON disabled - disables software flow control on outgoing data. This stops the process from being suspended if the output terminal cannot keep up. I presume this has little effect these days. I hope this means that output will be buffered if the terminal cannot keep up. In the old days the output might of been dropped?
raw mode is used for input.
- ISIG disabled - enables keyboard combinations that result in signals. TODO: should probably be a dynamic option.
- ECHO disabled - input is not echod to the output. TODO: should be a dynamic option.
- ICANON disabled - canonical mode (line mode) input is not used. TODO: should be a dynamic option.
- IEXTEN disabled - extended functions are disabled. TODO: I don't know what those are.