Skip to content

Commit

Permalink
[wicket] Support capital letters for some commands (#5863)
Browse files Browse the repository at this point in the history
We exclude vim commands.

Fixes #5796
  • Loading branch information
andrewjstone authored Jun 7, 2024
1 parent e48fd96 commit 9e1e6c5
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions wicket/src/keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,36 +182,36 @@ impl KeyHandler {
if let Some(seq) = self.seq {
match seq {
MultiKeySeqStart::g => match event.code {
KeyCode::Char('g') => {
KeyCode::Char('g') | KeyCode::Char('G') => {
self.seq = None;
return Some(Cmd::GotoTop);
}
KeyCode::Char('e') => {
KeyCode::Char('e') | KeyCode::Char('E') => {
self.seq = None;
return Some(Cmd::GotoBottom);
}
_ => (),
},
MultiKeySeqStart::CtrlR => match event.code {
KeyCode::Char('a')
KeyCode::Char('a') | KeyCode::Char('A')
if event.modifiers == KeyModifiers::CONTROL =>
{
self.seq = None;
return Some(Cmd::AbortUpdate);
}
KeyCode::Char('r')
KeyCode::Char('r') | KeyCode::Char('R')
if event.modifiers == KeyModifiers::CONTROL =>
{
self.seq = None;
return Some(Cmd::ResetState);
}
KeyCode::Char('s')
KeyCode::Char('s') | KeyCode::Char('S')
if event.modifiers == KeyModifiers::CONTROL =>
{
self.seq = None;
return Some(Cmd::DumpSnapshot);
}
KeyCode::Char('t')
KeyCode::Char('t') | KeyCode::Char('T')
if event.modifiers == KeyModifiers::CONTROL =>
{
self.seq = None;
Expand All @@ -230,10 +230,10 @@ impl KeyHandler {
KeyCode::Enter => Cmd::Enter,
KeyCode::Esc => Cmd::Exit,
KeyCode::Char(' ') => Cmd::Toggle,
KeyCode::Char('e') => Cmd::Expand,
KeyCode::Char('c') => Cmd::Collapse,
KeyCode::Char('d') => Cmd::Details,
KeyCode::Char('i') => Cmd::Ignition,
KeyCode::Char('e') | KeyCode::Char('E') => Cmd::Expand,
KeyCode::Char('c') | KeyCode::Char('C') => Cmd::Collapse,
KeyCode::Char('d') | KeyCode::Char('D') => Cmd::Details,
KeyCode::Char('i') | KeyCode::Char('I') => Cmd::Ignition,
KeyCode::Up => Cmd::Up,
KeyCode::Down => Cmd::Down,
KeyCode::Right => Cmd::Right,
Expand All @@ -242,18 +242,24 @@ impl KeyHandler {
KeyCode::PageDown => Cmd::PageDown,
KeyCode::Home => Cmd::GotoTop,
KeyCode::End => Cmd::GotoBottom,
KeyCode::Char('y') => Cmd::Yes,
KeyCode::Char('u') if event.modifiers == KeyModifiers::CONTROL => {
KeyCode::Char('y') | KeyCode::Char('Y') => Cmd::Yes,
KeyCode::Char('u') | KeyCode::Char('U')
if event.modifiers == KeyModifiers::CONTROL =>
{
Cmd::StartUpdate
}
KeyCode::Char('r') if event.modifiers == KeyModifiers::CONTROL => {
KeyCode::Char('r') | KeyCode::Char('R')
if event.modifiers == KeyModifiers::CONTROL =>
{
self.seq = Some(MultiKeySeqStart::CtrlR);
return None;
}
KeyCode::Char('k') if event.modifiers == KeyModifiers::CONTROL => {
KeyCode::Char('k') | KeyCode::Char('K')
if event.modifiers == KeyModifiers::CONTROL =>
{
Cmd::StartRackSetup
}
KeyCode::Char('n') => Cmd::No,
KeyCode::Char('n') | KeyCode::Char('N') => Cmd::No,
KeyCode::Tab => Cmd::NextPane,
KeyCode::BackTab => Cmd::PrevPane,

Expand Down

0 comments on commit 9e1e6c5

Please sign in to comment.