aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 5cf1be15..0cd1e674 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -230,8 +230,14 @@ fn main() {
match event {
glutin::Event::Closed => break 'main_loop,
glutin::Event::ReceivedCharacter(c) => {
- let encoded = c.encode_utf8();
- writer.write(encoded.as_slice()).unwrap();
+ match c {
+ // Ignore BACKSPACE and DEL. These are handled specially.
+ '\u{8}' | '\u{7f}' => (),
+ _ => {
+ let encoded = c.encode_utf8();
+ writer.write(encoded.as_slice()).unwrap();
+ }
+ }
},
glutin::Event::Resized(w, h) => {
terminal.resize(w as f32, h as f32);