Fixed AltGr characters not allowed in auth form

This commit is contained in:
veeso
2022-03-09 11:04:46 +01:00
committed by Christian Visintin
parent ad2781b62c
commit c45ebec261
6 changed files with 27 additions and 6 deletions

View File

@@ -483,9 +483,14 @@ fn handle_input_ev(
component.perform(Cmd::Delete);
Some(Msg::None)
}
Event::Keyboard(KeyEvent {
// NOTE: escaped control sequence
code: Key::Char('h') | Key::Char('r') | Key::Char('s'),
modifiers: KeyModifiers::CONTROL,
}) => Some(Msg::None),
Event::Keyboard(KeyEvent {
code: Key::Char(ch),
modifiers: KeyModifiers::NONE | KeyModifiers::SHIFT,
..
}) => {
component.perform(Cmd::Type(ch));
Some(Msg::Config(ConfigMsg::ConfigChanged))

View File

@@ -238,9 +238,14 @@ impl Component<Msg, NoUserEvent> for SshHost {
self.perform(Cmd::Delete);
Some(Msg::None)
}
Event::Keyboard(KeyEvent {
// NOTE: escaped control sequence
code: Key::Char('h') | Key::Char('r') | Key::Char('s'),
modifiers: KeyModifiers::CONTROL,
}) => Some(Msg::None),
Event::Keyboard(KeyEvent {
code: Key::Char(ch),
modifiers: KeyModifiers::NONE | KeyModifiers::SHIFT,
..
}) => {
self.perform(Cmd::Type(ch));
Some(Msg::None)

View File

@@ -893,9 +893,14 @@ impl Component<Msg, NoUserEvent> for InputColor {
let result = self.perform(Cmd::Delete);
self.update_color(result)
}
Event::Keyboard(KeyEvent {
// NOTE: escaped control sequence
code: Key::Char('h') | Key::Char('r') | Key::Char('s'),
modifiers: KeyModifiers::CONTROL,
}) => Some(Msg::None),
Event::Keyboard(KeyEvent {
code: Key::Char(ch),
modifiers: KeyModifiers::NONE | KeyModifiers::SHIFT,
..
}) => {
let result = self.perform(Cmd::Type(ch));
self.update_color(result)