You are not logged in.

#1 2012-05-26 14:48:26

cryptkeeper
Member
From: Zurich, Switzerland
Registered: 2011-12-29
Posts: 63

[SOLVED] move cursor with arrow keys

It just happened for the second time(*) now that after booting the touchpad doesn't work. It's not difficult to fix it, it just takes some googling. But what I'd like to have is the possibility to move around the cursor using the arrow keys (something like pressing ALT or whatever plus the arrow keys moves the cursor), because I don't always have a USB mouse around.

I already googled a bit but I didn't find a program allowing me this, although I'm quite sure that it's somehow possible. I just can't imagine that it isn't possible because it seems so fundamental to me.

Any tips?

(*) Well, from my system's point of view it's again the first time because some time after I fixed it the first time, my system crashed and the backup I restored was older than the first fix... So maybe, once it's fixed (again), the problem never appears again.

Last edited by cryptkeeper (2012-05-28 11:05:03)

Offline

#2 2012-05-26 16:13:46

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] move cursor with arrow keys

Offline

#3 2012-05-26 17:00:34

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,033
Website

Re: [SOLVED] move cursor with arrow keys

I seem to remember that functionality is built in to X: Press Shift + Num Lock. Then you can use the number pad to control the mouse.

I'm sorry I can't test it. I bought a Filco keyboard that doesn't have a number pad. sad It's a great keyboard, in case you were wondering. smile

Offline

#4 2012-05-26 17:25:01

cryptkeeper
Member
From: Zurich, Switzerland
Registered: 2011-12-29
Posts: 63

Re: [SOLVED] move cursor with arrow keys

karol wrote:

That looks like something I'm looking for. Unfortunately, I get an X11 error when I try to start it...

Actually, I don't even need such a fast and fancy solution as keynav seems to provide (thouth it generally sounds quite interesting), a minimalistic program allowing the navigation keys to move the cursor after a shortcut has been pressed would already be enough.

drcouzelis wrote:

I seem to remember that functionality is built in to X: Press Shift + Num Lock. Then you can use the number pad to control the mouse.

I'm sorry I can't test it. I bought a Filco keyboard that doesn't have a number pad. sad It's a great keyboard, in case you were wondering. smile

Now that you say it, I remember that this is possible with the numpad. Unfortunately, that doesn't help me on my 13" laptop (without a numpad)...

Offline

#5 2012-05-26 17:56:21

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

Re: [SOLVED] move cursor with arrow keys

install xdotool and:

from terminal 
Up)      xdotool mousemove_relative -- 0 -15
Down)  xdotool mousemove_relative 0 15
Right)   xdotool mousemove_relative 15 0
Left)     xdotool mousemove_relative -- -15 0
Return) xdotool click 1

from xchainkeys (first install xchainkeys and edit ~/.config/xchainkeys/xchainkeys.conf)
W-z Up :group xdotool mousemove_relative -- 0 -15
W-z Down :group xdotool mousemove_relative 0 15
W-z Right :group xdotool mousemove_relative 15 0
W-z Left :group xdotool mousemove_relative -- -15 0
W-z Return :group xdotool click 1   

W = mod4
 
from dwm
{ MODKEY, XK_Up, spawn, SHCMD("exec xdotool mousemove_relative -- 0 -15") },
        { MODKEY, XK_Down, spawn, SHCMD("exec xdotool mousemove_relative 0 15") },
        { MODKEY, XK_Right, spawn, SHCMD("exec xdotool mousemove_relative 15 0") },
        { MODKEY, XK_Left, spawn, SHCMD("exec xdotool mousemove_relative -- -15 0") },
        { MODKEY|ShiftMask, XK_Return, spawn, SHCMD("exec xdotool click 1") },

Last edited by ivoarch (2012-05-26 18:09:55)


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#6 2012-05-28 11:04:48

cryptkeeper
Member
From: Zurich, Switzerland
Registered: 2011-12-29
Posts: 63

Re: [SOLVED] move cursor with arrow keys

ivoarch wrote:

install xdotool and:

from terminal 
Up)      xdotool mousemove_relative -- 0 -15
Down)  xdotool mousemove_relative 0 15
Right)   xdotool mousemove_relative 15 0
Left)     xdotool mousemove_relative -- -15 0

Thanks for this. As I didn't get along with xchainkeys (I didn't get it to work properly and suddenly, my w key was lost until reboot), I just set up shortcuts for fast (ctl-arrow, speed 80) and slow (shift-ctrl-arrow, speed 8) cursor movements in the gnome shortcut settings. Works like a charm.

Offline

Board footer

Powered by FluxBB