Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failing to create output using examples on Debian Stretch #19

Open
GeekAnnoyed opened this issue Jan 7, 2017 · 1 comment
Open

failing to create output using examples on Debian Stretch #19

GeekAnnoyed opened this issue Jan 7, 2017 · 1 comment

Comments

@GeekAnnoyed
Copy link

Hello,
Sorry if this is "user error" I'm still learning python and trying to learn by doing a project.

I've looked at the joystick and example and then it failed to provide me with /dev/input/js4 or other device in the KDE joystick manager.
so I tried to use the example for the keyboard

import uinput

device = uinput.Device([
        uinput.KEY_E,
        uinput.KEY_H,
        uinput.KEY_L,
        uinput.KEY_O,
        ])

device.emit_click(uinput.KEY_H)
device.emit_click(uinput.KEY_E)
device.emit_click(uinput.KEY_L)
device.emit_click(uinput.KEY_L)
device.emit_click(uinput.KEY_O)

and I was expecting this to output Hello on my terminal
but I'm getting nothing, no errors or output.

I don't know how to get more debugging information out of python at the moment.

@zhangn1985
Copy link

if you run it as a python script, this script runs very fast, and Xorg has no time to add new evdev, before device is deleted.

you need to add a short sleep after device is created.

just like the examples in source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants