Mapping keyboard keys to act as mouse keys SOLVED

Using applications, configuring, problems
Post Reply
Message
Author
gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

Mapping keyboard keys to act as mouse keys SOLVED

#1 Post by gerry »

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??
Last edited by gerry on Tue 04 Aug 2015, 08:20, edited 1 time in total.

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#2 Post by Semme »

Gerry, you probably have setxkbmap, not the other two.

Check'm both by using "which xkbset/xmodmap" in a terminal.
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<

gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

#3 Post by gerry »

Thanks... the one that is missing is xkbset. I tried lifting the file from Mint (without much hope), and true enough, it does not work- presumably needs to be compiled in Puppy? Out of my scope, I'm afraid.

gerry

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#4 Post by Semme »

Mmm, try this one. It goes in /usr/bin. You'll know it's OK if: xkbset --help returns a "usage" cmd list.
Attachments
xkbset.gz
(15.62 KiB) Downloaded 95 times

gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

#5 Post by gerry »

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

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#6 Post by Semme »

Did you "xkbset --help" my binary?

Do those lines work by themselves?

Make life easy and paste us the whole script.
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<

gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

#7 Post by 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.

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#8 Post by Semme »

Either gzip it or change the extension to gz.
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<

gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

#9 Post by gerry »

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
Attachments
mousebind.gz
(268 Bytes) Downloaded 88 times
mousebindMINT.gz
(272 Bytes) Downloaded 91 times

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#10 Post by Semme »

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 <<<

gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

#11 Post by gerry »

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
80, and still learning - Gerry

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#12 Post by Semme »

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 <<<

gerry
Posts: 986
Joined: Thu 26 Jul 2007, 21:49
Location: England

#13 Post by gerry »

Thanks for your help Semme.

Final thought: where did your xkbset come from?
80, and still learning - Gerry

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#14 Post by Semme »

Though I highly doubt it's part of your issue, Precise. Care to try another?
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<

Post Reply