diff --git a/CHANGELOG.md b/CHANGELOG.md index c2ac811c..5933ba97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - Implement fuzzy search as default on Select and MultiSelect prompts. [#176](https://github.com/mikaelmello/inquire/pull/176) - Add new option on Select/MultiSelect prompts allowing to reset selection to the first item on filter-input changes. [#176](https://github.com/mikaelmello/inquire/pull/176) - Keybindings Ctrl-p and Ctrl-n added for Up and Down actions +- Keybindings Ctrl-j and Ctrl-g added for Enter and Cancel actions ### Fixes diff --git a/inquire/src/prompts/action.rs b/inquire/src/prompts/action.rs index a1368828..b1c1efb1 100644 --- a/inquire/src/prompts/action.rs +++ b/inquire/src/prompts/action.rs @@ -36,8 +36,8 @@ where I: InnerAction, { match key { - Key::Enter => Some(Action::Submit), - Key::Escape => Some(Action::Cancel), + Key::Enter | Key::Char('j', KeyModifiers::CONTROL) => Some(Action::Submit), + Key::Escape | Key::Char('g', KeyModifiers::CONTROL) => Some(Action::Cancel), Key::Char('c', KeyModifiers::CONTROL) => Some(Action::Interrupt), key => I::from_key(key, config).map(Action::Inner), }