@@ -36,7 +36,6 @@ pub(crate) mod keys {
36 pub(crate) const PAGEUP: &str = "pageup";
36 pub(crate) const PAGEUP: &str = "pageup";
37 pub(crate) const PAGEDOWN: &str = "pagedown";
37 pub(crate) const PAGEDOWN: &str = "pagedown";
38 pub(crate) const TAB: &str = "tab";
38 pub(crate) const TAB: &str = "tab";
39− pub(crate) const BACKTAB: &str = "backtab";
40 pub(crate) const DELETE: &str = "del";
39 pub(crate) const DELETE: &str = "del";
41 pub(crate) const INSERT: &str = "ins";
40 pub(crate) const INSERT: &str = "ins";
42 pub(crate) const NULL: &str = "null";
41 pub(crate) const NULL: &str = "null";
@@ -82,7 +81,6 @@ impl fmt::Display for KeyEvent {
82 KeyCode::PageUp => f.write_str(keys::PAGEUP)?,
81 KeyCode::PageUp => f.write_str(keys::PAGEUP)?,
83 KeyCode::PageDown => f.write_str(keys::PAGEDOWN)?,
82 KeyCode::PageDown => f.write_str(keys::PAGEDOWN)?,
84 KeyCode::Tab => f.write_str(keys::TAB)?,
83 KeyCode::Tab => f.write_str(keys::TAB)?,
85− KeyCode::BackTab => f.write_str(keys::BACKTAB)?,
86 KeyCode::Delete => f.write_str(keys::DELETE)?,
84 KeyCode::Delete => f.write_str(keys::DELETE)?,
87 KeyCode::Insert => f.write_str(keys::INSERT)?,
85 KeyCode::Insert => f.write_str(keys::INSERT)?,
88 KeyCode::Null => f.write_str(keys::NULL)?,
86 KeyCode::Null => f.write_str(keys::NULL)?,
@@ -116,7 +114,6 @@ impl UnicodeWidthStr for KeyEvent {
116 KeyCode::PageUp => keys::PAGEUP.len(),
114 KeyCode::PageUp => keys::PAGEUP.len(),
117 KeyCode::PageDown => keys::PAGEDOWN.len(),
115 KeyCode::PageDown => keys::PAGEDOWN.len(),
118 KeyCode::Tab => keys::TAB.len(),
116 KeyCode::Tab => keys::TAB.len(),
119− KeyCode::BackTab => keys::BACKTAB.len(),
120 KeyCode::Delete => keys::DELETE.len(),
117 KeyCode::Delete => keys::DELETE.len(),
121 KeyCode::Insert => keys::INSERT.len(),
118 KeyCode::Insert => keys::INSERT.len(),
122 KeyCode::Null => keys::NULL.len(),
119 KeyCode::Null => keys::NULL.len(),
@@ -166,7 +163,6 @@ impl std::str::FromStr for KeyEvent {
166 keys::PAGEUP => KeyCode::PageUp,
163 keys::PAGEUP => KeyCode::PageUp,
167 keys::PAGEDOWN => KeyCode::PageDown,
164 keys::PAGEDOWN => KeyCode::PageDown,
168 keys::TAB => KeyCode::Tab,
165 keys::TAB => KeyCode::Tab,
169− keys::BACKTAB => KeyCode::BackTab,
170 keys::DELETE => KeyCode::Delete,
166 keys::DELETE => KeyCode::Delete,
171 keys::INSERT => KeyCode::Insert,
167 keys::INSERT => KeyCode::Insert,
172 keys::NULL => KeyCode::Null,
168 keys::NULL => KeyCode::Null,
@@ -220,12 +216,20 @@ impl<'de> Deserialize<'de> for KeyEvent {
221#[cfg(feature = "term")]
217#[cfg(feature = "term")]
222impl From<crossterm::event::KeyEvent> for KeyEvent {
218impl From<crossterm::event::KeyEvent> for KeyEvent {
224− crossterm::event::KeyEvent { code, modifiers }: crossterm::event::KeyEvent,
219+ fn from(crossterm::event::KeyEvent { code, modifiers }: crossterm::event::KeyEvent) -> Self {
225− ) -> KeyEvent {
220+ if code == crossterm::event::KeyCode::BackTab {
226− KeyEvent {
221+ // special case for BackTab -> Shift-Tab
222+ let mut modifiers: KeyModifiers = modifiers.into();
223+ modifiers.insert(KeyModifiers::SHIFT);
227− code: code.into(),
230+ code: code.into(),
228− modifiers: modifiers.into(),
231+ modifiers: modifiers.into(),