diff options
author | Joe Wilm <joe@jwilm.com> | 2016-11-11 19:59:18 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-11-17 17:15:56 -0800 |
commit | 8360ab44ece57194ab40ddd280dcb5ce35ae91b7 (patch) | |
tree | 4a2f0a06081723f48ff86e3870b29aaca42e37f7 /src/event.rs | |
parent | 6925daa823a86aa8d3fafe21591bb883cb053ef3 (diff) | |
download | alacritty-8360ab44ece57194ab40ddd280dcb5ce35ae91b7.tar.gz alacritty-8360ab44ece57194ab40ddd280dcb5ce35ae91b7.zip |
Fallback to received chars when no bindings
Committed this on a plane with no internet; need to get a real glutin
ref pushed somewhere and update this commit before merging into master.
Diffstat (limited to 'src/event.rs')
-rw-r--r-- | src/event.rs | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/event.rs b/src/event.rs index 6e28f289..a2a4075d 100644 --- a/src/event.rs +++ b/src/event.rs @@ -37,41 +37,41 @@ impl<N: input::Notify> Processor<N> { fn handle_event(&mut self, event: glutin::Event) { match event { glutin::Event::Closed => panic!("window closed"), // TODO ... - glutin::Event::ReceivedCharacter(c) => { - match c { - // Ignore BACKSPACE and DEL. These are handled specially. - '\u{8}' | '\u{7f}' => (), - // Extra thing on macOS delete? - '\u{f728}' => (), - // OSX arrow keys send invalid characters; ignore. - '\u{f700}' | '\u{f701}' | '\u{f702}' | '\u{f703}' => (), - // Same with home/end. Am I missing something? Would be - // nice if glutin provided the received char in - // KeyboardInput event so a choice could be made there - // instead of having to special case everything. - '\u{f72b}' | '\u{f729}' | '\u{f72c}' | '\u{f72d}' => (), - // These letters are handled in the bindings system - 'v' => (), - _ => { - println!("printing char {:?}", c); - let buf = encode_char(c); - self.notifier.notify(buf); - } - } - }, + // glutin::Event::ReceivedCharacter(c) => { + // match c { + // // Ignore BACKSPACE and DEL. These are handled specially. + // '\u{8}' | '\u{7f}' => (), + // // Extra thing on macOS delete? + // '\u{f728}' => (), + // // OSX arrow keys send invalid characters; ignore. + // '\u{f700}' | '\u{f701}' | '\u{f702}' | '\u{f703}' => (), + // // Same with home/end. Am I missing something? Would be + // // nice if glutin provided the received char in + // // KeyboardInput event so a choice could be made there + // // instead of having to special case everything. + // '\u{f72b}' | '\u{f729}' | '\u{f72c}' | '\u{f72d}' => (), + // // These letters are handled in the bindings system + // 'v' => (), + // _ => { + // println!("printing char {:?}", c); + // let buf = encode_char(c); + // self.notifier.notify(buf); + // } + // } + // }, glutin::Event::Resized(w, h) => { self.resize_tx.send((w, h)).expect("send new size"); // Acquire term lock let mut terminal = self.terminal.lock(); terminal.dirty = true; }, - glutin::Event::KeyboardInput(state, _code, key, mods) => { + glutin::Event::KeyboardInput(state, _code, key, mods, string) => { // Acquire term lock let terminal = self.terminal.lock(); let processor = &mut self.input_processor; let notifier = &mut self.notifier; - processor.process_key(state, key, mods, notifier, *terminal.mode()); + processor.process_key(state, key, mods, notifier, *terminal.mode(), string); }, glutin::Event::MouseInput(state, button) => { let terminal = self.terminal.lock(); |