aboutsummaryrefslogtreecommitdiffstats
path: root/src/callbacks.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/callbacks.rs')
-rw-r--r--src/callbacks.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/callbacks.rs b/src/callbacks.rs
new file mode 100644
index 0000000..256eb58
--- /dev/null
+++ b/src/callbacks.rs
@@ -0,0 +1,13 @@
+/// This trait is used with `Parser::process_cb` to handle extra escape
+/// sequences that don't have an impact on the terminal screen directly.
+pub trait Callbacks {
+ /// This callback is called when the terminal requests an audible bell
+ /// (typically with `^G`).
+ fn audible_bell(&mut self, _: &mut crate::Screen) {}
+ /// This callback is called when the terminal requests an visual bell
+ /// (typically with `\eg`).
+ fn visual_bell(&mut self, _: &mut crate::Screen) {}
+ /// This callback is called when the terminal receives invalid input
+ /// (such as an invalid UTF-8 character or an used control character).
+ fn error(&mut self, _: &mut crate::Screen) {}
+}