vty-4.7.0.20: A simple terminal UI library

Safe Haskell | None

Graphics.Vty.LLInput

Synopsis

- data Key
  - = KEsc
  - | KFun Int
  - | KBackTab
  - | KPrtScr
  - | KPause
  - | KASCII Char
  - | KBS
  - | KIns
  - | KHome
  - | KPageUp
  - | KDel
  - | KEnd
  - | KPageDown
  - | KBegin
  - | KNP5
  - | KUp
  - | KMenu
  - | KLeft
  - | KDown
  - | KRight
  - | KEnter
- data Modifier
  - = MShift
  - | MCtrl
  - | MMeta
  - | MAlt
- data Button
  - = BLeft
  - | BMiddle
  - | BRight
- data Event
  - = EvKey Key [Modifier]
  - | EvMouse Int Int Button [Modifier]
  - | EvResize Int Int
- initTermInput :: Int -> Terminal -> IO (IO Event, IO ())

# Documentation

data Key Source

Representations of non-modifier keys.

Constructors

KEsc |
KFun Int |
KBackTab |
KPrtScr |
KPause |
KASCII Char |
KBS |
KIns |
KHome |
KPageUp |
KDel |
KEnd |
KPageDown |
KBegin |
KNP5 |
KUp |
KMenu |
KLeft |
KDown |
KRight |
KEnter |

Instances

Eq Key |
Ord Key |
Show Key |

data Modifier Source

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.

Constructors

MShift |
MCtrl |
MMeta |
MAlt |

Instances

Eq Modifier |
Ord Modifier |
Show Modifier |

data Button Source

Mouse buttons. Not yet used.

Constructors

BLeft |
BMiddle |
BRight |

Instances

Eq Button |
Ord Button |
Show Button |

data Event Source

Generic events.

Constructors

EvKey Key [Modifier] |
EvMouse Int Int Button [Modifier] |
EvResize Int Int |

Instances

Eq Event |
Ord Event |
Show Event |

initTermInput :: Int -> Terminal -> IO (IO Event, IO ())Source

Set up the terminal for input. Returns a function which reads key events, and a function for shutting down the terminal access.