3

I wanted to know if there were any python modules that allow access to keyboard interrupts non-disruptively. I wanted to make a text-to-speech program, perhaps for the blind programmer out there, and wanted to know how to grab key-presses in real time. There exists things like pyHook for Windows, but what do I use for Linux? Ideally I should be able to get the events such as KB_UP in Windows.

I like orca, but I wanted to design a text-to-speech myself better suited to my needs. If such a thing does not exist for python, what language should I choose to implement such a program? I have heard of pyGame for keyboard input, but I want my program to incur minimal overhead and work in the background.

2

1 Answer 1

3

As usual for linux, there are a variety of different interfaces that can do different parts of what you want on different systems.

I'm guessing what you want is a way to talk to the /dev/input/* interfaces. You can do that just by opening them and ioctling and reading from them, but you probably don't want to do that.

evdev looks like a nice wrapper around both /dev/input/* and the uinput APIs.

Of you could grab pykeylogger and hack up the source to do what you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.