Merge pull request #43233 from madmiraal/fix-42876

Remove unneeded filter on joy_axis()
This commit is contained in:
Rémi Verschelde 2020-11-16 22:41:14 +01:00 committed by GitHub
commit fbe0386c65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 9 deletions

View file

@ -937,14 +937,6 @@ void Input::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
return;
}
if (p_value.value > joy.last_axis[p_axis]) {
if (p_value.value < joy.last_axis[p_axis] + joy.filter) {
return;
}
} else if (p_value.value > joy.last_axis[p_axis] - joy.filter) {
return;
}
//when changing direction quickly, insert fake event to release pending inputmap actions
float last = joy.last_axis[p_axis];
if (p_value.min == 0 && (last < 0.25 || last > 0.75) && (last - 0.5) * (p_value.value - 0.5) < 0) {

View file

@ -147,7 +147,6 @@ private:
bool connected = false;
bool last_buttons[JOY_BUTTON_MAX] = { false };
float last_axis[JOY_AXIS_MAX] = { 0.0f };
float filter = 0.01f;
int last_hat = HAT_MASK_CENTER;
int mapping = -1;
int hat_current = 0;