crates/terminal/src/keyboard_to_esc.rs 🔗
@@ -0,0 +1,5 @@
+use gpui::KeyDownEvent;
+
+fn to_esc_str(event: &KeyDownEvent) -> &str {
+ "Test"
+}
Mikayla Maki created
crates/terminal/src/keyboard_to_esc.rs | 5 +++++
crates/terminal/src/terminal.rs | 3 ++-
crates/terminal/src/terminal_element.rs | 24 ++++++++++++++++--------
3 files changed, 23 insertions(+), 9 deletions(-)
@@ -0,0 +1,5 @@
+use gpui::KeyDownEvent;
+
+fn to_esc_str(event: &KeyDownEvent) -> &str {
+ "Test"
+}
@@ -1,5 +1,6 @@
-pub mod color_translation;
+mod color_translation;
pub mod connection;
+mod keyboard_to_esc;
mod modal;
pub mod terminal_element;
@@ -360,14 +360,22 @@ impl Element for TerminalEl {
cx.dispatch_action(ScrollTerminal(vertical_scroll.round() as i32));
})
.is_some(),
- Event::KeyDown(KeyDownEvent {
- input: Some(input), ..
- }) => cx
- .is_parent_view_focused()
- .then(|| {
- cx.dispatch_action(Input(input.to_string()));
- })
- .is_some(),
+ Event::KeyDown(
+ e @ KeyDownEvent {
+ input: Some(input), ..
+ },
+ ) => {
+ dbg!(e);
+ cx.is_parent_view_focused()
+ .then(|| {
+ cx.dispatch_action(Input(input.to_string()));
+ })
+ .is_some()
+ }
+ Event::KeyDown(e) => {
+ dbg!(e);
+ false
+ }
_ => false,
}
}