summaryrefslogtreecommitdiff
path: root/platform/linuxbsd/joypad_linux.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-04-28 15:19:37 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-04-28 15:19:49 +0200
commitfdf58a585839804c89798392dd93025dbe8654e4 (patch)
tree7e5fa3980a90d34d2f89f2b6c9adc392e890eeb6 /platform/linuxbsd/joypad_linux.cpp
parent39f7a4092533a600eeada6638016af8bd4bd2271 (diff)
Rename InputFilter back to Input
It changed name as part of the DisplayServer and input refactoring in #37317, with the rationale that input no longer goes through the main loop, so the previous Input singleton now only does filtering. But the gains in consistency are quite limited in the renaming, and it breaks compatibility for all scripts and tutorials that access the Input singleton via the scripting language. A temporary option was suggested to keep the scripting singleton named `Input` even if its type is `InputFilter`, but that adds inconsistency and breaks C#. Fixes godotengine/godot-proposals#639. Fixes #37319. Fixes #37690.
Diffstat (limited to 'platform/linuxbsd/joypad_linux.cpp')
-rw-r--r--platform/linuxbsd/joypad_linux.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
index 381eb909ba..5ceea788e0 100644
--- a/platform/linuxbsd/joypad_linux.cpp
+++ b/platform/linuxbsd/joypad_linux.cpp
@@ -71,7 +71,7 @@ void JoypadLinux::Joypad::reset() {
dpad = 0;
fd = -1;
- InputFilter::JoyAxis jx;
+ Input::JoyAxis jx;
jx.min = -1;
jx.value = 0.0f;
for (int i = 0; i < MAX_ABS; i++) {
@@ -80,7 +80,7 @@ void JoypadLinux::Joypad::reset() {
}
}
-JoypadLinux::JoypadLinux(InputFilter *in) {
+JoypadLinux::JoypadLinux(Input *in) {
exit_udev = false;
input = in;
joy_thread = Thread::create(joy_thread_func, this);
@@ -436,11 +436,11 @@ void JoypadLinux::joypad_vibration_stop(int p_id, uint64_t p_timestamp) {
joy.ff_effect_timestamp = p_timestamp;
}
-InputFilter::JoyAxis JoypadLinux::axis_correct(const input_absinfo *p_abs, int p_value) const {
+Input::JoyAxis JoypadLinux::axis_correct(const input_absinfo *p_abs, int p_value) const {
int min = p_abs->minimum;
int max = p_abs->maximum;
- InputFilter::JoyAxis jx;
+ Input::JoyAxis jx;
if (min < 0) {
jx.min = -1;
@@ -492,11 +492,11 @@ void JoypadLinux::process_joypads() {
case ABS_HAT0X:
if (ev.value != 0) {
if (ev.value < 0)
- joy->dpad |= InputFilter::HAT_MASK_LEFT;
+ joy->dpad |= Input::HAT_MASK_LEFT;
else
- joy->dpad |= InputFilter::HAT_MASK_RIGHT;
+ joy->dpad |= Input::HAT_MASK_RIGHT;
} else
- joy->dpad &= ~(InputFilter::HAT_MASK_LEFT | InputFilter::HAT_MASK_RIGHT);
+ joy->dpad &= ~(Input::HAT_MASK_LEFT | Input::HAT_MASK_RIGHT);
input->joy_hat(i, joy->dpad);
break;
@@ -504,11 +504,11 @@ void JoypadLinux::process_joypads() {
case ABS_HAT0Y:
if (ev.value != 0) {
if (ev.value < 0)
- joy->dpad |= InputFilter::HAT_MASK_UP;
+ joy->dpad |= Input::HAT_MASK_UP;
else
- joy->dpad |= InputFilter::HAT_MASK_DOWN;
+ joy->dpad |= Input::HAT_MASK_DOWN;
} else
- joy->dpad &= ~(InputFilter::HAT_MASK_UP | InputFilter::HAT_MASK_DOWN);
+ joy->dpad &= ~(Input::HAT_MASK_UP | Input::HAT_MASK_DOWN);
input->joy_hat(i, joy->dpad);
break;
@@ -517,7 +517,7 @@ void JoypadLinux::process_joypads() {
if (ev.code >= MAX_ABS)
return;
if (joy->abs_map[ev.code] != -1 && joy->abs_info[ev.code]) {
- InputFilter::JoyAxis value = axis_correct(joy->abs_info[ev.code], ev.value);
+ Input::JoyAxis value = axis_correct(joy->abs_info[ev.code], ev.value);
joy->curr_axis[joy->abs_map[ev.code]] = value;
}
break;