diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2021-03-25 16:56:12 -0400 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2021-06-20 11:54:24 -0400 |
commit | 0ce49800acf464c2242c3f7e021b4ab8f49ec366 (patch) | |
tree | ba1b10099dfbaf9798a16f619493a49a37701dbc /core/input/input_event.cpp | |
parent | e919d894f84ea86ee43a3e1b8a675b9fec28f01c (diff) |
Use mouse and joypad enums instead of plain integers
Also MIDIMessage
Diffstat (limited to 'core/input/input_event.cpp')
-rw-r--r-- | core/input/input_event.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 14762f955c..52a6c5d64f 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -516,11 +516,11 @@ float InputEventMouseButton::get_factor() const { return factor; } -void InputEventMouseButton::set_button_index(int p_index) { +void InputEventMouseButton::set_button_index(MouseButton p_index) { button_index = p_index; } -int InputEventMouseButton::get_button_index() const { +MouseButton InputEventMouseButton::get_button_index() const { return button_index; } @@ -845,11 +845,11 @@ void InputEventMouseMotion::_bind_methods() { /////////////////////////////////// -void InputEventJoypadMotion::set_axis(int p_axis) { +void InputEventJoypadMotion::set_axis(JoyAxis p_axis) { axis = p_axis; } -int InputEventJoypadMotion::get_axis() const { +JoyAxis InputEventJoypadMotion::get_axis() const { return axis; } @@ -947,11 +947,11 @@ void InputEventJoypadMotion::_bind_methods() { /////////////////////////////////// -void InputEventJoypadButton::set_button_index(int p_index) { +void InputEventJoypadButton::set_button_index(JoyButton p_index) { button_index = p_index; } -int InputEventJoypadButton::get_button_index() const { +JoyButton InputEventJoypadButton::get_button_index() const { return button_index; } @@ -1046,7 +1046,7 @@ String InputEventJoypadButton::to_string() { return vformat("InputEventJoypadButton: button_index=%d, pressed=%s, pressure=%.2f", button_index, p, pressure); } -Ref<InputEventJoypadButton> InputEventJoypadButton::create_reference(int p_btn_index) { +Ref<InputEventJoypadButton> InputEventJoypadButton::create_reference(JoyButton p_btn_index) { Ref<InputEventJoypadButton> ie; ie.instantiate(); ie->set_button_index(p_btn_index); @@ -1403,11 +1403,11 @@ int InputEventMIDI::get_channel() const { return channel; } -void InputEventMIDI::set_message(const int p_message) { +void InputEventMIDI::set_message(const MIDIMessage p_message) { message = p_message; } -int InputEventMIDI::get_message() const { +MIDIMessage InputEventMIDI::get_message() const { return message; } |