diff --git a/src/config.rs b/src/config.rs index 800db38..c8f8773 100644 --- a/src/config.rs +++ b/src/config.rs @@ -11,6 +11,8 @@ pub struct ConsoleConfig { pub theme: ConsoleTheme, /// The key used to open the developer console. pub open_key: KeyCode, + /// The key used to submit a command to the command parser. + pub submit_key: KeyCode } impl Default for ConsoleConfig { @@ -18,6 +20,7 @@ impl Default for ConsoleConfig { Self { theme: ConsoleTheme::ONE_DARK, open_key: KeyCode::Backquote, + submit_key: KeyCode::Enter } } } diff --git a/src/ui.rs b/src/ui.rs index eaffebd..2c836d3 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -77,7 +77,7 @@ pub(crate) fn render_ui( } }; - if key.just_pressed(KeyCode::Enter) { + if key.just_pressed(config.submit_key) { submit_command(&mut state.command); }