summaryrefslogtreecommitdiff
path: root/lib/key.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/key.ml')
-rw-r--r--lib/key.ml19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/key.ml b/lib/key.ml
index d6656c5..22338f4 100644
--- a/lib/key.ml
+++ b/lib/key.ml
@@ -32,6 +32,25 @@ let of_char = function
32 | c when Char.(c < ' ') -> Char.to_int c + 64 |> Char.of_int_exn |> ctrl 32 | c when Char.(c < ' ') -> Char.to_int c + 64 |> Char.of_int_exn |> ctrl
33 | c -> Key c 33 | c -> Key c
34 34
35let to_string = function
36 | Arrow_down -> "<down>"
37 | Arrow_left -> "<left>"
38 | Arrow_right -> "<right>"
39 | Arrow_up -> "<up>"
40 | Backspace -> "<backspace>"
41 | Ctrl c -> Printf.sprintf "<c-%c>" c
42 | Delete -> "<delete>"
43 | End -> "<end>"
44 | Enter -> "<cr>"
45 | Esc -> "<esc>"
46 | Home -> "<home>"
47 | Key ' ' -> "<space>"
48 | Key c -> String.of_char c
49 | Nul -> "<nil>"
50 | Page_down -> "<pgdown>"
51 | Page_up -> "<pgup>"
52 | Tab -> "<tab>"
53
35let stream = 54let stream =
36 let step s c = 55 let step s c =
37 let open Sequence.Step in 56 let open Sequence.Step in