Keyboard hook in linux

Michael Torrie torriem at gmail.com
Sun Jan 13 11:46:31 EST 2013


On 01/13/2013 09:13 AM, K. Elo wrote:
> I have searched in the Web and in several tutorials (e.g. "Programming 
> python"), but this seems to be a tricky one. The 'pyHook' library seems 
> to offer a keyboard hook manager, but 'pyHook' is not available for 
> linux :( IMHO, the 'curses' library offers no (direct) solution to this...

You're wrong.  curses does offer a direct solution to this.  Check the
docs.  Also here's a nice intro document for Python 3:
http://docs.python.org/dev/howto/curses.html

You can check to see if a keystroke is waiting, grab it and then do
something useful.  curses can even grab keys like page up or page down.




More information about the Python-list mailing list