mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
fix(ui): restrict Ctrl key handling to typing mode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user