Merge pull request #121 from jimbo1qaz/patch-1

Add hard-coded deadzone into input configuration buttons.
This commit is contained in:
Milan Nikolic 2018-03-06 12:58:25 +01:00 committed by GitHub
commit 164577efde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,8 +100,10 @@ class InputButton(QPushButton):
self.clearFocus()
def on_axis_value_changed(self, axis, value):
val = "-" if value < 0 else "+"
self.on_joystick_event("axis", axis, val)
# SDL axes range from -32768 to 32767. Only map axes which are half-pressed or more.
if abs(value) >= 16384:
val = "-" if value < 0 else "+"
self.on_joystick_event("axis", axis, val)
def on_button_value_changed(self, button, value):
if value: