Refactor keyboard mode by enum

This commit is contained in:
Asura
2022-07-19 15:43:13 +08:00
parent 0bacc1c250
commit 02b4d7f1d9
4 changed files with 36 additions and 21 deletions

View File

@@ -420,11 +420,11 @@ impl Connection {
}
MessageInput::Key((mut msg, press)) => {
// todo: press and down have similar meanings.
if press && msg.mode == 0 {
if press && msg.mode.unwrap() == KeyboardMode::Legacy {
msg.down = true;
}
handle_key(&msg);
if press && msg.mode == 0 {
if press && msg.mode.unwrap() == KeyboardMode::Legacy {
msg.down = false;
handle_key(&msg);
}