Page 1 of 1

Pointer movement using home row keys?

Posted: 07 Feb 2013, 09:45
by wolfv
I would like to mouse using the home row keys.
Something similar to the “Mouse Lock Layer” described on http://www.key64.org/design
Is there a similar software I can install on Windows or Linux to use on my conventional keyboard?

Thank you.

Posted: 07 Feb 2013, 10:09
by Icarium
You can do it with a simple autohotkey script.

Posted: 07 Feb 2013, 15:15
by sordna
I use it all the time with mouskeys. Do the below commands on linux, and it makes your numpad move the pointer (on my Kinesis Advantage I also have a mod where I press an arcade button with my palm, and enables the numpad layer under my right hand)

Code: Select all

xkbset m # enable mousekeys
xkbset exp =m # avoid expiring mousekeys
xkbset ma 100 12 80 20 100 # adjust mousekeys acceleration
xkbset exp =ma # avoid expiring mouskeys acceleration
On my KBC Poker X, I had to use xmodmap to remap the keyboard to a numpad *while* pushing down the AltGr. The script should work on regular keyboards with minimal modification, try it out and let me know:

Code: Select all

#!/bin/sh -x
# Run script without arguments for a 2nd layer on the Poker,
# or with any argument to reset back to default.

setxkbmap -option
if [ "$#" -gt 0 ]; then
  setxkbmap us
  xkbset -m
  exit
fi

# Mousekeys, comment out if you want an actual numpad, or simply run
# xkbset -m / xkbset m to toggle between the two behaviors.
xkbset m # enable mousekeys
xkbset exp =m # avoid expiring mousekeys

# Choose a keymap that has an extra layer (level 3),
# add compose key (shift+ralt) and caps lock toggle by pressing both shifts:
setxkbmap 'us(altgr-intl)' -option lv3:ralt_switch_multikey,shift:both_capslock

# menu to grave/tilde:
xmodmap -e 'keycode 135 = grave asciitilde grave asciitilde'

# rwin/super to altgr:
xmodmap -e 'remove mod4 = Super_R'
xmodmap -e 'keycode 134 = ISO_Level3_Shift Multi_key'

# caps to altgr (shift+caps locks it!):
xmodmap -e 'remove Lock = Caps_Lock'
xmodmap -e 'keycode 66 = ISO_Level3_Shift ISO_Level3_Lock'

# numpad (just the keys needed for mouskeys)
xmodmap -e 'keycode 30 = u U u U KP_7 KP_Home'
xmodmap -e 'keycode 31 = i I i I KP_8 KP_Up'
xmodmap -e 'keycode 32 = o O o O KP_9 KP_Prior'
xmodmap -e 'keycode 44 = j J j J KP_4 KP_Left'
xmodmap -e 'keycode 45 = k K k K KP_5 KP_Begin'
xmodmap -e 'keycode 46 = l L l L KP_6 KP_Right'
xmodmap -e 'keycode 58 = m M m M KP_1 KP_End'
xmodmap -e 'keycode 59 = comma less comma less KP_2 KP_Down'
xmodmap -e 'keycode 60 = period greater period greater KP_3 KP_Next'
xmodmap -e 'keycode 19 = 0 parenright 0 parenright KP_0 KP_Insert'
xmodmap -e 'keycode 47 = semicolon colon semicolon colon KP_Decimal KP_Delete'
xmodmap -e 'keycode 20 = minus underscore minus underscore KP_Subtract KP_Subtract'
xmodmap -e 'keycode 61 = slash question slash question KP_Divide KP_Divide'

# that's all folks

Posted: 08 Feb 2013, 14:04
by hasu
My lame AHK mousekey. I don't use this because of lack of acceleration.
https://gist.github.com/tmk/4738892

You may want to look into this script instead, though I've not tried this because I have no numpad.
http://www.autohotkey.com/docs/scripts/NumpadMouse.ahk

Posted: 19 Feb 2013, 23:14
by wolfv
Thank you for all your responses. That autohotkey is quite powerful.