diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/input_default.cpp | 4 | ||||
-rw-r--r-- | main/input_default.h | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index 3c40be5082..de7f8ebb4d 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -194,8 +194,6 @@ void InputDefault::joy_connection_changed(int p_idx, bool p_connected, String p_ Joypad js; js.name = p_connected ? p_name : ""; js.uid = p_connected ? p_guid : ""; - js.mapping = -1; - js.hat_current = 0; if (p_connected) { @@ -797,12 +795,12 @@ InputDefault::JoyEvent InputDefault::_find_to_event(String p_to) { JoyEvent ret; ret.type = -1; + ret.index = 0; int i = 0; while (buttons[i]) { if (p_to == buttons[i]) { - //printf("mapping button %s\n", buttons[i]); ret.type = TYPE_BUTTON; ret.index = i; ret.value = 0; diff --git a/main/input_default.h b/main/input_default.h index 6dd88cd31e..8a65303df3 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -97,7 +97,6 @@ class InputDefault : public Input { int hat_current; Joypad() { - for (int i = 0; i < JOY_AXIS_MAX; i++) { last_axis[i] = 0.0f; @@ -110,6 +109,7 @@ class InputDefault : public Input { last_hat = HAT_MASK_CENTER; filter = 0.01f; mapping = -1; + hat_current = 0; } }; |