You are not logged in.

#1 2012-06-27 19:15:25

Archenduser
Member
Registered: 2011-08-12
Posts: 29

Keyboard as a mouse

I notice when a computer doesn't recognize the mouse there is a slow way to get around using the windows key.

What if we just assigned wasd to focus (and move) on mouse position (enter= button 1 and context key= button 2) as a default so that no keyboard using computer could lack mouse interface?

I don't like keyboard only, so a fail safe like this could be epic.

Offline

#2 2012-06-27 19:21:33

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Keyboard as a mouse

There's already a virtual mouse in X, you have to activate it first:

Section "InputClass"
	Identifier	"keyboard"
	MatchIsKeyboard	"on"
        MatchDevicePath "/dev/input/event*"
	Option		"XkbOptions"	"keypad:pointerkeys"
	Driver		"evdev"
EndSection

Or at runtime:

setxkbmap -option keypad:pointerkeys

Then there's a key combination to activate this and the keypad will move the cursor. Though I always forget the key combination to activate it smile, so you'll have to google it.

Last edited by Gusar (2012-06-28 08:50:43)

Offline

#3 2012-06-27 19:53:01

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Keyboard as a mouse

Moving from Arch Discussion to Applications & Desktop Environments.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#4 2012-06-28 08:38:24

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Keyboard as a mouse

Actually it's:

$ setxkbmap -option keypad:pointerkeys

...which is only temporary, until the next reboot. Either place it in ~/.xinitrc, .bash_profile, the autostart file (for Openbox), etc., or from a file in /etc/X11/xorg.conf.d/ :

https://wiki.archlinux.org/index.php/X# … ointerkeys
http://en.wikipedia.org/wiki/Mouse_keys


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#5 2012-06-28 08:50:26

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Keyboard as a mouse

Oops, you're right. I'll correct my post above.

Offline

#6 2012-06-28 09:11:46

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Keyboard as a mouse

Don't worry about it.

I wonder if it's possible to use /etc/X11/xorg.conf.d/10-keyboard.conf. Here's what I have so far:

Section "InputClass"
    Identifier             "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option                 "XkbLayout"   "us, ro(std)"
    Option                 "XkbOptions"  "grp:alt_shift_toggle, grp_led:scroll"
EndSection

Adding another "Section" or another "Option" doesn't seem to work. And creating a "/etc/X11/xorg.conf.d/20-pointerkeys.conf" file is screwing with the keyboard layout. The only thing that works is to run this at startup (from ~/.xinitrc, ~/.bash_profile, etc):

$ setxkbmap -option keypad:pointerkeys

"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#7 2012-06-28 09:43:39

Gusar
Member
Registered: 2009-08-25
Posts: 3,607

Re: Keyboard as a mouse

Add it to your existing XkbOptions line, it takes as many options as you want, separated by comma.

Last edited by Gusar (2012-06-28 09:44:31)

Offline

#8 2012-06-28 10:29:47

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Keyboard as a mouse

I've been looking through the Xorg wiki page and here's my new /etc/X11/xorg.conf.d/10-keyboard.conf:

Section "InputClass"
    Identifier             "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option                 "XkbLayout"   "us, ro(std)"
    Option                 "XkbOptions"  "grp:alt_shift_toggle, grp_led:scroll, terminate:ctrl_alt_bksp, keypad:pointerkeys"
EndSection

Thanks.

Archenduser, don't forget to mark it as solved if this is what you were looking for.

Last edited by DSpider (2012-06-28 10:32:15)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#9 2012-06-28 21:00:09

zarel
Member
Registered: 2012-06-07
Posts: 10

Re: Keyboard as a mouse

I'm currently using pointerkeys when I don't have a USB mouse with me because my touchpad seems electronically dead.

I didn't want to merge the pointerkeys settings with the keyboard layout configuration so I created the file /etc/X11/xorg.conf.d/20-pointerkeys.conf:

 Section "InputClass"
    Identifier             "PointerKeys"
    MatchIsKeyboard        "yes"
    Option                 "XkbOptions" "keypad:pointerkeys"
EndSection

Pointerkeys are disabled by default at boot time, but you can simply enable them by pressing Shift+NumLock ( I think it's customizable).

When the pointerkeys are enabled your numpad works as a three buttons mouse. Don't expect it to change the numlock setting, when you press Shift+Numlock the NumLock led stays exactly the same.

1,2,3,4,6,7,8,9 are used to move the cursor around
5 is used to trigger a single click, or a double click if you're quick enough
pressing 0 is like clicking and holding the button down, so you can use it for drag'n'drop. press 5 to release
slash, asterisk and minus select which button are you going to click with 5.
/ selects the left button
* the middle button
- the right button

The movements acceleration and so on can be customized, but I never tried.

Pointerkeys are not very comfortable, but they're really helpful for emergencies as most GUI applications are not really keyboard-friendly.

Offline

#10 2012-06-29 03:47:34

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: Keyboard as a mouse

Something quicker to move around with is also keynav.

Offline

#11 2012-06-29 20:45:02

zarel
Member
Registered: 2012-06-07
Posts: 10

Re: Keyboard as a mouse

I'm trying keynav and it seems nice, if you don't use the default configuration.

Last edited by zarel (2012-06-29 20:46:22)

Offline

Board footer

Powered by FluxBB