I want to automate my typing. I can use window managers such as gnome and fvwm.

I can access to ubuntu and obsd.

  • Your Question is not much clear. Please explain it in clear format. – SHW Apr 28 '11 at 15:38
  • @SHW: I am not sure what it is, sometimes it is called userspace macro but I want just that keys are pressed according to some pattern in X. By X, I mean that I want it work with programs in X. – user2362 Apr 28 '11 at 16:06

There are several tools to simulate a key press, for example xdotool. Although the underlying interface uses keycodes, xdotool does the job of translating keysyms back into keysyms, which is usually very convenient.

If you really need to specify a keycode, I don't know of a command line utility for that, but you can write a small C or python or $favorite_language program¹. Again, you almost always want to specify keysyms, not keycodes.

To do something every minute, either put it in a crontab, or write a shell loop (you probably want the latter, so you can kill it easily):

while sleep 60; do xdotool key A; done

¹ I might be able to dig up some Python if there's demand.

|improve this answer|||||
  • ...for python there is always D! – user2362 Apr 29 '11 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy