GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Home
  • About

This view

  • Original page
  • New address

GeezerVison is showing codebright.wordpress.com — SendKeys in Linux

← Strange behaviour using ctypes in IronPython
PHP and Python →

SendKeys in Linux

Posted on June 27, 2010 by codebright

SendKeys is a useful function in the Windows API which enables a program to send keystrokes. I was looking for an equivalent in Linux, first in Ubuntu at home, and then in Fedora 13 at work.

For Ubuntu (Hardy Heron, 8.04), I found xautomation, which worked fine. For many (but not all) of the non alpha-numeric keystrokes, you need to use the name of the key – there is a helpful list here.

I tried xautomation with Fedora 13, but it was not happy. So I had a look around for an alternative. One possibility (I found them hard to find) was xdotool. Of course, the syntax for sending keystrokes is slightly different! It is slightly more consistent in that non-alphanumerics all need to be sent using the name of the key, so the helpful list (above) is still helpful!

I’ll try to post some examples at a later date.

Share this:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
Like Loading...

Related

This entry was posted in Software. Bookmark the permalink.
← Strange behaviour using ctypes in IronPython
PHP and Python →

1 Response to SendKeys in Linux

  1. Henry Charles's avatar Henry Charles says:
    March 9, 2012 at 1:54 pm

    Found this, works great: https://sourceforge.net/projects/x11guitest/

    Reply

Leave a Reply Cancel reply

  • Recent Posts

    • Linear Algebra Review and numpy
    • Tuple Trivia
    • globals and __main__: a Python gotcha
    • Edge case for split / explode
    • Reading gzip files in Python – fast!
  • Recent Comments

    Leszek Pryszcz's avatarLeszek Pryszcz on Reading gzip files in Python…
    devboell's avatardevboell on Reading gzip files in Python…
    How to test a direct… on Reading gzip files in Python…
    Tommy Carstensen's avatarTommy Carstensen on Reading gzip files in Python…
    Tommy Carstensen's avatarTommy Carstensen on Reading gzip files in Python…
  • Archives

    • October 2011
    • July 2011
    • June 2011
    • April 2011
    • March 2011
    • February 2011
    • October 2010
    • June 2010
    • May 2010
  • Categories

    • Python
    • Software
    • Uncategorized
  • Meta

    • Create account
    • Log in
    • Entries feed
    • Comments feed
    • WordPress.com
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Comment
  • Reblog
  • Subscribe Subscribed
  • Codebright's Blog
    Copy shortlinkView post in Reader
    Manage subscriptionsSign upLog in
    Report this content
    Collapse this bar
Create your own website, free on WordPress.com.Create your own website.
Start free
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.