Ubuntu – Enable/disable mousekeys via command line

14.04command linekeyboardmouse

My desktop has an old mouse that has broken left and right click buttons that always double-click. I tried to solve that by enabling Mousekeys from the Accessibility settings, but there are a number of problems with this:

  1. I believe mousekeys is supposed to toggle when the Num Lock key is pressed, but it does not do so. Whether or not Num Lock is on, the mousekeys remains working; I can't use the numpad to type in numbers.
  2. At startup, even though the system settings says Mousekeys is still enabled, it actually isn't. The numpad doesn't start working in Mousekeys mode until I toggle the MouseKeys option off and on again.
  3. The motion of the mouse using the keys is far too slow to be usable. It seems to travel at less than 10 pixels per second.

(3) isn't a terrible problem as I can still use the physical mouse to move the cursor, and just use the numpad to register the left and right clicks. However, (2) is slightly annoying and (1) is extremely annoying. I've seen another forum post say that Ctrl+Shift+NumLock will also toggle MouseKeys, but that was old and does not seem to work on my system.

Should problems (1) and (2) be listed as bug reports? If not, then is there a command line method to enable and disable MouseKeys? And is there an option on this command to modify the movement speed of the mouse?

Btw, I'm using Ubuntu 14.04 LTS.

Best Answer

Please give this article a look, it is potentially a duplicate or at least a similar issue:

Turn Mousekeys on/off from keyboard