Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

I can access to ubuntu and obsd.

share|improve this question
    
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
add comment

1 Answer

up vote 3 down vote accepted

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.