summaryrefslogtreecommitdiff
path: root/src/Term.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Term.zig')
-rw-r--r--src/Term.zig44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/Term.zig b/src/Term.zig
index 41452757..504aef7a 100644
--- a/src/Term.zig
+++ b/src/Term.zig
@@ -77,3 +77,47 @@ pub const Grid = struct {
/// memory for its pin). Taped: a screen-state replica, which feeds
/// nothing, is told its authority's.
pub const Told = struct { rows: []const i32, erased: []const bool, cleared: bool, alive: bool, failed: bool };
+
+// ---- input ----
+
+/// One key for its program, as the program's keyboard protocol and modes
+/// ask for it, written out.
+pub const key = terminal.key;
+/// One mouse event for its program, as the mode and format it set ask for
+/// it; empty when the program does not hear of it.
+pub const mouse = terminal.mouse;
+/// A wheel turn for its program; null when the wheel is not the program's.
+pub const wheel = terminal.wheel;
+/// A paste as xterm makes one: three parts, the text between the brackets
+/// when the program set 2004.
+pub const paste = terminal.paste;
+/// The modes its program set that the core decides by (`Modes`).
+pub const modes = terminal.modes;
+/// How far left or right a click on the prompt line moves the shell's
+/// cursor, at the prompt the cursor is at.
+pub const promptMoves = terminal.promptMoves;
+
+/// The key a frontend read (Event.zig).
+pub const Key = @import("Event.zig").Key;
+pub const MouseMods = struct { shift: bool = false, alt: bool = false, ctrl: bool = false };
+pub const MouseButton = enum { left, middle, right, wheel_up, wheel_down, wheel_left, wheel_right };
+pub const MouseAction = enum { press, release, motion };
+/// Cursor-key presses: so many left, so many right.
+pub const Moves = struct { left: usize = 0, right: usize = 0 };
+
+/// The modes a program set that the core decides by.
+pub const Modes = struct {
+ /// It tracks the mouse itself (1000, 1002, 1003).
+ mouse: bool = false,
+ /// ...every move of it (1003).
+ all_motion: bool = false,
+ /// A wheel over it is its own: it tracks the mouse, or it is on the
+ /// alternate screen with alternate scroll (1007).
+ wheel: bool = false,
+ /// It wants to hear focus in and out (1004).
+ focus: bool = false,
+ /// It wants its pastes bracketed (2004).
+ bracketed_paste: bool = false,
+ /// It has the alternate screen (1049).
+ alternate: bool = false,
+};