diff options
author | tomsmeding <tom.smeding@gmail.com> | 2019-08-19 13:00:05 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2019-08-19 13:17:48 +0200 |
commit | 4e5590d148a7f2b517dce18c231b9d4cb0b1d19f (patch) | |
tree | dd04cecda1525f826f06752102ea2a58754fdbf7 /src/System/IO/Terminal/Input/Key.hs |
Import of source files
Diffstat (limited to 'src/System/IO/Terminal/Input/Key.hs')
-rw-r--r-- | src/System/IO/Terminal/Input/Key.hs | 27 |
1 files changed, 27 insertions, 0 deletions
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) |