Refactor simulate to support switching keyboard modes

This commit is contained in:
Asura
2022-07-17 20:34:08 -07:00
parent 7c24f6bb12
commit 5dab7bd9a2
5 changed files with 84 additions and 122 deletions

View File

@@ -419,15 +419,8 @@ impl Connection {
handle_mouse(&msg, id);
}
MessageInput::Key((mut msg, press)) => {
if press {
msg.down = true;
}
// todo: press and down have similar meanings.
handle_key(&msg);
let keyboard_mode = 1;
if press && keyboard_mode != 1{
msg.down = false;
handle_key(&msg);
}
}
MessageInput::BlockOn => {
if crate::platform::block_input(true) {