Mapping keyboard keys to act as mouse keys SOLVED
Mapping keyboard keys to act as mouse keys SOLVED
I obtained a script to map two unused keys to act as mouse keys, because the mouse keys on my old original Acer Aspire One are difficult to use.
The script is basicly the three commands:
setxkbmap -layout gb
xkbset -m
xkbset exp = m
xmodmap -e "keycode 133 = Pointer Button1"
xmodmap -e "keycode 135 = Pointer Button3"
I'm using Slacko 5.7, and can't get these commands to work. It works ok in Mint.
Any ideas??
The script is basicly the three commands:
setxkbmap -layout gb
xkbset -m
xkbset exp = m
xmodmap -e "keycode 133 = Pointer Button1"
xmodmap -e "keycode 135 = Pointer Button3"
I'm using Slacko 5.7, and can't get these commands to work. It works ok in Mint.
Any ideas??
Last edited by gerry on Tue 04 Aug 2015, 08:20, edited 1 time in total.
Thanks for the xkbset.
However, I still can't get the script to work on Puppy. In fact, only the last two lines:
xmodmap -e "keycode 133 =Pointer_Button1"
xmodmap -e "keycode 135 =Pointer_Button3"
are needed.
I put in an echo statement so that it shows that it is running, and the script runs in the terminal ok, but does not actually do anything.
I ran xev to check the key codes, and left windows button shows as 115, instead of 133, and right windows button as 117, not 135. Changing the script to match still does not do anything. (But they are 133 and 135 as MINT sees them- weird!)
This is frustrating, because the script works perfectly on this machine in MINT, and I've put it where it runs on startup (after login actually, though I'm looking for somewhere sooner, seems to be difficult with systemd).
gerry
However, I still can't get the script to work on Puppy. In fact, only the last two lines:
xmodmap -e "keycode 133 =Pointer_Button1"
xmodmap -e "keycode 135 =Pointer_Button3"
are needed.
I put in an echo statement so that it shows that it is running, and the script runs in the terminal ok, but does not actually do anything.
I ran xev to check the key codes, and left windows button shows as 115, instead of 133, and right windows button as 117, not 135. Changing the script to match still does not do anything. (But they are 133 and 135 as MINT sees them- weird!)
This is frustrating, because the script works perfectly on this machine in MINT, and I've put it where it runs on startup (after login actually, though I'm looking for somewhere sooner, seems to be difficult with systemd).
gerry
yes, of course I did as you suggested, and got the right answer. However, when I tried it with the native functions, I did not get anything in response to --help or -h.
I'll post the script as soon as I find out how to do it- I tried to do it as an attachment, but .sh is not allowed, nor is .txt, and I've no time at the moment- do it in a couple of hours time.
I'll post the script as soon as I find out how to do it- I tried to do it as an attachment, but .sh is not allowed, nor is .txt, and I've no time at the moment- do it in a couple of hours time.
I think I've attached two files- mousebind and mousebindMINT. mousebind is the original, mousebindMINT is what is working in mint. They are both .sh files, not .gz.
gerry
gerry
- Attachments
-
- mousebind.gz
- (268 Bytes) Downloaded 88 times
-
- mousebindMINT.gz
- (272 Bytes) Downloaded 91 times
Gerry, try with this line added.
Code: Select all
#Turn on AccessX
xkbset a
#Turn on mousekeys
xkbset m
#Stop mousekeys expiring after a timeout
xkbset exp =m
#Map keysym to another keysym
sleep 1
xmodmap -e "keycode 133 = Pointer_Button1"
xmodmap -e "keycode 135 = Pointer_Button3"
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<
Thanks- that works, except there's this weirdness: as I mentioned above, the left windows key is keycode 115, and the right hand key is 117. But for MINT, on the same machine/keyboard, they are the standard 133 and 135.
How can that be?
I've put the script in ~/startup, and it runs OK at start.
Gerry
How can that be?
I've put the script in ~/startup, and it runs OK at start.
Gerry
80, and still learning - Gerry
Not that I've looked into it Gerry, but the issue may lie with how Pup implements BusyBox, aka setkeycodes.
Code: Select all
setkeycode: even number of arguments expected
usage: setkeycode scancode keycode ...
(where scancode is either xx or e0xx, given in hexadecimal,
and keycode is given in decimal)
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<