@@ -36,7 +36,6 @@ pub(crate) mod keys {
3636 pub(crate) const PAGEUP: &str = "pageup";
3737 pub(crate) const PAGEDOWN: &str = "pagedown";
3838 pub(crate) const TAB: &str = "tab";
39− pub(crate) const BACKTAB: &str = "backtab";
4039 pub(crate) const DELETE: &str = "del";
4140 pub(crate) const INSERT: &str = "ins";
4241 pub(crate) const NULL: &str = "null";
@@ -82,7 +81,6 @@ impl fmt::Display for KeyEvent {
8281 KeyCode::PageUp => f.write_str(keys::PAGEUP)?,
8382 KeyCode::PageDown => f.write_str(keys::PAGEDOWN)?,
8483 KeyCode::Tab => f.write_str(keys::TAB)?,
85− KeyCode::BackTab => f.write_str(keys::BACKTAB)?,
8684 KeyCode::Delete => f.write_str(keys::DELETE)?,
8785 KeyCode::Insert => f.write_str(keys::INSERT)?,
8886 KeyCode::Null => f.write_str(keys::NULL)?,
@@ -116,7 +114,6 @@ impl UnicodeWidthStr for KeyEvent {
116114 KeyCode::PageUp => keys::PAGEUP.len(),
117115 KeyCode::PageDown => keys::PAGEDOWN.len(),
118116 KeyCode::Tab => keys::TAB.len(),
119− KeyCode::BackTab => keys::BACKTAB.len(),
120117 KeyCode::Delete => keys::DELETE.len(),
121118 KeyCode::Insert => keys::INSERT.len(),
122119 KeyCode::Null => keys::NULL.len(),
@@ -166,7 +163,6 @@ impl std::str::FromStr for KeyEvent {
166163 keys::PAGEUP => KeyCode::PageUp,
167164 keys::PAGEDOWN => KeyCode::PageDown,
168165 keys::TAB => KeyCode::Tab,
169− keys::BACKTAB => KeyCode::BackTab,
170166 keys::DELETE => KeyCode::Delete,
171167 keys::INSERT => KeyCode::Insert,
172168 keys::NULL => KeyCode::Null,
@@ -220,12 +216,20 @@ impl<'de> Deserialize<'de> for KeyEvent {
220216
221217#[cfg(feature = "term")]
222218impl From<crossterm::event::KeyEvent> for KeyEvent {
223− fn from(
224− crossterm::event::KeyEvent { code, modifiers }: crossterm::event::KeyEvent,
225− ) -> KeyEvent {
226− KeyEvent {
227− code: code.into(),
228− modifiers: modifiers.into(),
219+ fn from(crossterm::event::KeyEvent { code, modifiers }: crossterm::event::KeyEvent) -> Self {
220+ if code == crossterm::event::KeyCode::BackTab {
221+ // special case for BackTab -> Shift-Tab
222+ let mut modifiers: KeyModifiers = modifiers.into();
223+ modifiers.insert(KeyModifiers::SHIFT);
224+ Self {
225+ code: KeyCode::Tab,
226+ modifiers,
227+ }
228+ } else {
229+ Self {
230+ code: code.into(),
231+ modifiers: modifiers.into(),
232+ }
229233 }
230234 }
231235}