fix(ui): restrict Ctrl key handling to typing mode

This commit is contained in:
2026-07-21 14:56:56 +08:00
parent 3b529cb9a4
commit 293b29226c
2 changed files with 9 additions and 6 deletions

View File

@@ -191,6 +191,7 @@ bool ClientPlayer::update_player_move_state(Key key, KeyAction action) {
}
} else if (key == Key::LEFT_CTRL) {
if (action == KeyAction::PRESS) {
m_sprinting = true;
}
/*

View File

@@ -246,6 +246,7 @@ bool TextField::handle_key_event(const KeyEvent& e) {
}
}
if (e.key == Key::LEFT_CTRL) {
if (m_typing) {
if (e.action == KeyAction::PRESS) {
m_ctrl_press = true;
return true;
@@ -254,6 +255,7 @@ bool TextField::handle_key_event(const KeyEvent& e) {
return true;
}
}
}
if (e.key == Key::ESCAPE && e.action == KeyAction::PRESS) {
stop_typing(false);