mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Use Key enum instead of plain integers
This commit is contained in:
parent
18bd0fee5a
commit
fa3a32a2d6
43 changed files with 173 additions and 102 deletions
|
@ -307,21 +307,21 @@ bool InputEventKey::is_pressed() const {
|
|||
return pressed;
|
||||
}
|
||||
|
||||
void InputEventKey::set_keycode(uint32_t p_keycode) {
|
||||
void InputEventKey::set_keycode(Key p_keycode) {
|
||||
keycode = p_keycode;
|
||||
emit_changed();
|
||||
}
|
||||
|
||||
uint32_t InputEventKey::get_keycode() const {
|
||||
Key InputEventKey::get_keycode() const {
|
||||
return keycode;
|
||||
}
|
||||
|
||||
void InputEventKey::set_physical_keycode(uint32_t p_keycode) {
|
||||
void InputEventKey::set_physical_keycode(Key p_keycode) {
|
||||
physical_keycode = p_keycode;
|
||||
emit_changed();
|
||||
}
|
||||
|
||||
uint32_t InputEventKey::get_physical_keycode() const {
|
||||
Key InputEventKey::get_physical_keycode() const {
|
||||
return physical_keycode;
|
||||
}
|
||||
|
||||
|
@ -387,7 +387,7 @@ String InputEventKey::to_string() {
|
|||
return vformat("InputEventKey: keycode=%s, mods=%s, physical=%s, pressed=%s, echo=%s", kc, mods, physical, p, e);
|
||||
}
|
||||
|
||||
Ref<InputEventKey> InputEventKey::create_reference(uint32_t p_keycode) {
|
||||
Ref<InputEventKey> InputEventKey::create_reference(Key p_keycode) {
|
||||
Ref<InputEventKey> ie;
|
||||
ie.instantiate();
|
||||
ie->set_keycode(p_keycode & KEY_CODE_MASK);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue