EV_ABS doesn't work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-uinput |
Fix Released
|
Wishlist
|
a |
Bug Description
I think Absolute events aren't working but maybe i am doing some wrong, am new to input drivers. I am trying to do a joystick, my code:
### joystick.py
#! /usr/bin/env python
#http://
import time
import uinput
def main():
capabilities = {
abs_parameters = {uinput.ABS_X:(0, 255, 0, 0)} #abs_min, abs_max, abs_fuzz, abs_flat
device = uinput.
for i in range(5):
if __name__ == "__main__":
main()
### Traceback
$ sudo python2 joystick.py
Traceback (most recent call last):
File "joystick.py", line 23, in <module>
main()
File "joystick.py", line 18, in main
device.
File "/usr/lib/
suinput.
IOError: [Errno 22] Invalid argument
Changed in python-uinput: | |
status: | In Progress → Fix Committed |
Changed in python-uinput: | |
status: | Fix Committed → Fix Released |
Thank your for reporting this issue. You are missing the absolute parameter setting for ABS_Y axis. If you replace::
abs_parameters = {uinput.ABS_X:(0, 255, 0, 0)} #abs_min, abs_max, abs_fuzz, abs_flat
with::
abs_parameters = {uinput.ABS_X:(0, 255, 0, 0),
uinput. ABS_Y:( 0, 255, 0, 0)}
then it works. Could you please test with that change and report back here the results.
However, I'm grateful for reporting this issue, because it shows me two things:
1. The whole module is badly documented (the documentation is missing totally).
2. Device-class should provide reasonable default values for abs_parameters.
Those two things will be fixed for the next release.