Beginning research

This commit is contained in:
Mikayla Maki 2022-07-12 18:06:34 -07:00
parent efad2a9ccd
commit 2ca340b9f1
3 changed files with 23 additions and 9 deletions

View file

@ -0,0 +1,5 @@
use gpui::KeyDownEvent;
fn to_esc_str(event: &KeyDownEvent) -> &str {
"Test"
}

View file

@ -1,5 +1,6 @@
pub mod color_translation; mod color_translation;
pub mod connection; pub mod connection;
mod keyboard_to_esc;
mod modal; mod modal;
pub mod terminal_element; pub mod terminal_element;

View file

@ -360,14 +360,22 @@ impl Element for TerminalEl {
cx.dispatch_action(ScrollTerminal(vertical_scroll.round() as i32)); cx.dispatch_action(ScrollTerminal(vertical_scroll.round() as i32));
}) })
.is_some(), .is_some(),
Event::KeyDown(KeyDownEvent { Event::KeyDown(
e @ KeyDownEvent {
input: Some(input), .. input: Some(input), ..
}) => cx },
.is_parent_view_focused() ) => {
dbg!(e);
cx.is_parent_view_focused()
.then(|| { .then(|| {
cx.dispatch_action(Input(input.to_string())); cx.dispatch_action(Input(input.to_string()));
}) })
.is_some(), .is_some()
}
Event::KeyDown(e) => {
dbg!(e);
false
}
_ => false, _ => false,
} }
} }