diff options
| author | 2022-01-01 23:57:41 +0200 | |
|---|---|---|
| committer | 2022-01-01 23:57:41 +0200 | |
| commit | f03a4b178eacd13226eaaba5f8d10892ccf78711 (patch) | |
| tree | 09ebb7ac3e1750d3c03d3e7dad570a873f132907 /src/key.zig | |
| parent | Update make mode (diff) | |
| download | es-f03a4b178eacd13226eaaba5f8d10892ccf78711.tar.gz es-f03a4b178eacd13226eaaba5f8d10892ccf78711.tar.xz es-f03a4b178eacd13226eaaba5f8d10892ccf78711.zip | |
changes
Diffstat (limited to 'src/key.zig')
| -rw-r--r-- | src/key.zig | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/key.zig b/src/key.zig index 3a007fb..5376017 100644 --- a/src/key.zig +++ b/src/key.zig | |||
| @@ -14,12 +14,22 @@ pub const Key = enum(u16) { | |||
| 14 | right, | 14 | right, |
| 15 | up, | 15 | up, |
| 16 | down, | 16 | down, |
| 17 | delete, | ||
| 18 | home, | 17 | home, |
| 19 | end, | 18 | end, |
| 19 | delete, | ||
| 20 | page_up, | 20 | page_up, |
| 21 | page_down, | 21 | page_down, |
| 22 | 22 | ||
| 23 | ctrl_left, | ||
| 24 | ctrl_right, | ||
| 25 | ctrl_up, | ||
| 26 | ctrl_down, | ||
| 27 | ctrl_home, | ||
| 28 | ctrl_end, | ||
| 29 | // ctrl_delete, | ||
| 30 | // ctrl_page_up, | ||
| 31 | // ctrl_page_down, | ||
| 32 | |||
| 23 | _, | 33 | _, |
| 24 | 34 | ||
| 25 | pub fn char(ch: u8) Key { | 35 | pub fn char(ch: u8) Key { |
| @@ -53,12 +63,22 @@ pub const Key = enum(u16) { | |||
| 53 | .right => std.fmt.formatBuf("<right>", options, writer), | 63 | .right => std.fmt.formatBuf("<right>", options, writer), |
| 54 | .up => std.fmt.formatBuf("<up>", options, writer), | 64 | .up => std.fmt.formatBuf("<up>", options, writer), |
| 55 | .down => std.fmt.formatBuf("<down>", options, writer), | 65 | .down => std.fmt.formatBuf("<down>", options, writer), |
| 56 | .delete => std.fmt.formatBuf("<delete>", options, writer), | ||
| 57 | .home => std.fmt.formatBuf("<home>", options, writer), | 66 | .home => std.fmt.formatBuf("<home>", options, writer), |
| 58 | .end => std.fmt.formatBuf("<end>", options, writer), | 67 | .end => std.fmt.formatBuf("<end>", options, writer), |
| 68 | .delete => std.fmt.formatBuf("<delete>", options, writer), | ||
| 59 | .page_up => std.fmt.formatBuf("<page-up>", options, writer), | 69 | .page_up => std.fmt.formatBuf("<page-up>", options, writer), |
| 60 | .page_down => std.fmt.formatBuf("<page-down>", options, writer), | 70 | .page_down => std.fmt.formatBuf("<page-down>", options, writer), |
| 61 | 71 | ||
| 72 | .ctrl_left => std.fmt.formatBuf("C-<left>", options, writer), | ||
| 73 | .ctrl_right => std.fmt.formatBuf("C-<right>", options, writer), | ||
| 74 | .ctrl_up => std.fmt.formatBuf("C-<up>", options, writer), | ||
| 75 | .ctrl_down => std.fmt.formatBuf("C-<down>", options, writer), | ||
| 76 | .ctrl_home => std.fmt.formatBuf("C-<home>", options, writer), | ||
| 77 | .ctrl_end => std.fmt.formatBuf("C-<end>", options, writer), | ||
| 78 | // ctrl_delete | ||
| 79 | // ctrl_page_up | ||
| 80 | // ctrl_page_down | ||
| 81 | |||
| 62 | _ => key.formatGeneric(options, writer), | 82 | _ => key.formatGeneric(options, writer), |
| 63 | }; | 83 | }; |
| 64 | } | 84 | } |