diff options
author | Stany MARCEL <stanypub@gmail.com> | 2015-11-04 03:40:00 +0300 |
---|---|---|
committer | Stany MARCEL <stanypub@gmail.com> | 2015-11-04 03:44:32 +0300 |
commit | cd7c66d3a6c6d7f334dd5cc043cc89ccc2f19afa (patch) | |
tree | 90d636a4525edcd0dee53f8c0a6e15ad4e78248b /scripts | |
parent | 4f360079a916a9d694f958d25e81bb3217dd9e0d (diff) |
Increase compatibility with xbox360 gamepad
Add min, max, fuzz and flat settings in abs uinput init
The gamepad emulation Now works with kodi.
Signed-off-by: Stany MARCEL <stanypub@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/sc-xbox.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/sc-xbox.py b/scripts/sc-xbox.py index 2872eb3..1bf581d 100755 --- a/scripts/sc-xbox.py +++ b/scripts/sc-xbox.py @@ -67,12 +67,12 @@ def lpad_func(x, btn, threshold, evstick, evtouch, clicked, invert): if x >= 0: if x >= threshold: - x = 32767 + x = 1 else: x = 0 else: if x <= -threshold: - x = -32767 + x = -1 else: x = 0 events.append((evtouch, x if not invert else -x, x != 0)) @@ -85,8 +85,8 @@ def lpad_func(x, btn, threshold, evstick, evtouch, clicked, invert): axis_map = { - 'ltrig' : lambda x, btn: [(Axes.ABS_Z, int(-32767 + ((x*2.0*32767.0)/255.)), False)], - 'rtrig' : lambda x, btn: [(Axes.ABS_RZ, int(-32767 + ((x*2.0*32767.0)/255.)), False)], + 'ltrig' : lambda x, btn: [(Axes.ABS_Z, x, False)], + 'rtrig' : lambda x, btn: [(Axes.ABS_RZ, x, False)], 'lpad_x' : lambda x, btn: lpad_func(x, btn, 15000, Axes.ABS_X, Axes.ABS_HAT0X, False, False), 'lpad_y' : lambda x, btn: lpad_func(x, btn, 15000, Axes.ABS_Y, Axes.ABS_HAT0Y, False, True), 'rpad_x' : lambda x, btn: [(Axes.ABS_RX, x, False)], |