From 4e5590d148a7f2b517dce18c231b9d4cb0b1d19f Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Mon, 19 Aug 2019 13:00:05 +0200 Subject: Import of source files --- src/System/IO/Terminal/Input/Key.hs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/System/IO/Terminal/Input/Key.hs (limited to 'src/System/IO/Terminal/Input/Key.hs') diff --git a/src/System/IO/Terminal/Input/Key.hs b/src/System/IO/Terminal/Input/Key.hs new file mode 100644 index 0000000..40b52c3 --- /dev/null +++ b/src/System/IO/Terminal/Input/Key.hs @@ -0,0 +1,27 @@ +{-| +Module : System.IO.Terminal.Input.Key +Copyright : (c) UU, 2019 +License : MIT +Maintainer : Tom Smeding +Stability : experimental +Portability : POSIX, macOS, Windows +-} +module System.IO.Terminal.Input.Key where + + +-- | A keypress. This does not attempt to model all possible keypresses +-- that the user may enter, since not all can be recognised in the terminal +-- anyway. The argument to 'KInvalid' contains some description of the +-- unknown key. +data Key = KChar Char + | KUp | KDown | KRight | KLeft + | KEnter | KDelete | KBackspace + | KPageDown | KPageUp | KHome | KEnd + | KTab + | KEsc + | KMod { kShift :: Bool + , kCtrl :: Bool + , kAlt :: Bool + , kKey :: Key } + | KInvalid String + deriving (Eq, Ord, Show) -- cgit v1.2.3-70-g09d2