Using keys instead of mouse buttons, possible?

Using applications, configuring, problems
Post Reply
Message
Author
mini-jaguar
Posts: 597
Joined: Thu 13 Nov 2008, 13:45

Using keys instead of mouse buttons, possible?

#1 Post by mini-jaguar »

I would be interested if there is a way to use keyboard shortcuts, for example alt-Z, X and C to emulate left, center and right mouse buttons.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

For what it's worth, the Tab key usually cycles through the hot links and other active buttons on a browser page.

Burunduk
Posts: 80
Joined: Sun 21 Aug 2011, 21:44

#3 Post by Burunduk »

Maybe MouseKeys — numeric keypad as a mouse replacement is what you need. Alt+Shift+NumLock and Shift+NumLock both can be used to (de)activate this feature on Lupu 525 (I didn't test it on other Puppies). It works but something is wrong with acceleration.

mini-jaguar
Posts: 597
Joined: Thu 13 Nov 2008, 13:45

#4 Post by mini-jaguar »

Actually I found Sven, which theoretically does what I am looking for, unfortunately in practice it can't do all what the mouse buttons do.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#5 Post by greengeek »

Hi mini-jaguar, do you have any further info about SVEN? I am interested to see if it will help me to emulate a mouse doubleclick via a keyboard key.

mini-jaguar
Posts: 597
Joined: Thu 13 Nov 2008, 13:45

#6 Post by mini-jaguar »

I don't remember that well because it was a while ago, but I do remember that it didn't do the job that well, at most it let you select between a couple of buttons on a menu. If it would have worked well I would have used it.

It comes already installed in some Puppies, and there are packages for others.

May I ask what to you need it for? I originally wanted it because most Puppies have poor support for Macbook touchpads, then I found FatDog64 600, which works very well on Macs, and lost interest in trying to emulate the buttons.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#7 Post by greengeek »

mini-jaguar wrote:May I ask what to you need it for? I originally wanted it because most Puppies have poor support for Macbook touchpads, then I found FatDog64 600, which works very well on Macs
My 86 year old father is struggling with doubleclicking so I am looking for an alternative. I've just posted here:
http://murga-linux.com/puppy/viewtopic.php?t=82328.

That's interesting about fatdog - I have been looking at some of the external touchpads designed for MAC (they are beautiful..) and I think they would be a great alternative to a mouse. And with the tap-to-click function turned off it would be a good way to separate the "pointer motion" from the "clicking" if I added a second mouse modified to only have the click button function on it. That way I could reduce the chance of my dad dragging icons and folders where they should not be.

mini-jaguar
Posts: 597
Joined: Thu 13 Nov 2008, 13:45

#8 Post by mini-jaguar »

Actually I used FatDog64 on a Macbook with a button, to activate the other button you hold two fingers on the touchpad while you click, I think you could even get the third button with three fingers (Ubuntu works the same way).

But FatDog64 is the only Puppy version that works with the Mac touchpad and doesn't have the tap on, all the other versions the touchpad either doesn't work at all or the tap is always on because flsynclient doesn't work properly with macs on them, which can really drive you up the wall.


Although I don't know if you're going to have much luck with this. You can set Puppy to use single clicks only on its own o.s., but you're talking internet stuff (in the other thread). I'm not sure though.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#9 Post by seaside »

mini-jaguar and greengeek,

Perhaps you could make it work by using Xdotool.

Assign a hotkey to a script using xdotool to simulate mouse-clicks. Then place cursor where you want the click and then hit the script hotkey.

I haven't tried it, but it should work.

Cheers,
s
(You can find xdotool here
http://208.109.22.214/puppy/viewtopic.p ... 65aadf5f61 )

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#10 Post by greengeek »

seaside wrote:Perhaps you could make it work by using Xdotool.
Thanks seaside. Xdotool looks very interesting. My scripting ability is in it's infancy (actually pre-embryonic is a better word...) but I will dig up some xdotool tutorials and see what is possible.

EDIT: I think what I would need to do is:
1) Assign F9 key (which is the key I want to use as my "doubleclick" function) as a hotkey to run xdotool script.
2) Execute xdotool script that emulates the key sequence which activates Mousekeys function of xorg (ie: "shift numlock"), delays x milliseconds, then emulates depression of "+" key.

- one issue for me to figure out is how I differentiate between "+" on the numeric keypad and "+" on the "=" key. I shall look into this more closely.

EDIT AGAIN: mini-jaguar: these links look like they might be helpful for both your original requirements and mine too:
http://tuxradar.com/content/xdotool-script-your-mouse
http://www.semicomplete.com/projects/xd ... tool.xhtml

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#11 Post by seaside »

greengeek,

It looks like you have a good start and perhaps the program "xev" can give you the keycodes for below.
- one issue for me to figure out is how I differentiate between "+" on the numeric keypad and "+" on the "=" key. I shall look into this more closely.
Cheers,
s

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#12 Post by greengeek »

Actually, it turns out I don't even need to activate the "ShiftNumlock". It works as required if I do the following:

1) Place cursor over the email I want to open.
2) Type "xdotool click 1 click 1" in a previously opened terminal.

(xdotool has the ability to simulate mouse clicks directly)

All I need to do now is write that into a script and attach it to the F9 key.

Notes:
click 1 = single left click
click 2 = single middle click
click 3 = single right click

click 1 click 1 = two left clicks separated by 12millisecond delay (= doubleclick)

Thanks seaside - this feels like powerful stuff!

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#13 Post by greengeek »

Ive got the doubleclick function working as I want it to now. I have assigned it to the F9 key.

1) First I made a script called doubleclick_xdotool as follows:

Code: Select all

#!/bin/sh
xdotool click 1 click 1
I placed this script in /usr/bin and made it executable (by rightclicking and selecting permissions)

2) Then I assigned a hotkey function to the F9 key. This was harder than I expected (haven’t done this before) but I got some tips from here:
http://www.murga-linux.com/puppy/viewtopic.php?t=57085

What I did was to make a backup of /root/.jwm/jwmrc-personal then edit it to add the following line to the list of other Key lines:

Code: Select all

<Key keycode="75">exec:doubleclick_xdotool</Key>


(keycode 75 is the code for the F9 key)

Then I restarted the jwm and now I can press F9 any time I want the doubleclick function. Just have to make sure the mouse pointer is sitting where I want it before I press the F9 key.

Thanks all for the suggestions.

Post Reply