Search code examples
pythonmacoskeypress

How to generate keyboard keypress events through Python to control PP presentation?


I need to programmatically control powerpoint/pdf presentations (the 4 direction keystrokes need to work at the minimum to go to the previous and next slides).

What library/module/framework can I use with Python to do this on OS X?

I've seen a lot of discussion on doing this in Windows and C# (or OS X and Quartz), but nothing particularly with Python. A cross-platform library / framework would be even better.

Overall, I would like to programmatically control my presentation with Python on OS X (as part of a hobby project, and probably also useful in my own short presentations).


Solution

  • You can try PyQt or wxPython

    Here is a link for how to handle key press with PyQt - http://www.saltycrane.com/blog/2008/01/how-to-capture-tab-key-press-event-with/

    and for wxPython - http://www.wxpython.org/docs/api/wx.KeyEvent-class.html and http://zetcode.com/wxpython/events/