Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On windows I have an autohotkey script which:

  • Only works when caps lock is on
  • Generates left, middle and right mouse button events when left control, menu and alt keys are pressed
  • Allows holding the keys down (for dragging objects)

Is there an easy way of duplicating this functionality in linux?

share|improve this question

X has a built-in mechanism for controlling the mouse cursor with the keyboard. Press the Pointer_EnableKeys key to activate this mode (mouse keys mode); it's usually bound to Shift+NumLock.

In mouse keys mode, the keypad arrows move the pointer around, and the other keypad keys emulate buttons (/*- are left, middle, right respectively; + is left double-click, and 0 and . are left press and release).

See mouse keys for more information. By the way, this mode can be enabled on Windows too.

share|improve this answer
Thanks, but I'm afraid mousekeys won't work because I still use the mouse in my right hand to move the cursor. And even if I could reassign the keys used by the mousekeys program, I would have to explicitly change between left, middle or right. With my ahk script I can rest my fingers on the three keys and press any or a combination of them instantly. – typist Jul 22 '11 at 21:47

You could probably do the same things with Tcl ('tickle').

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.