Doubleclick function performed by keyboard key [SOLVED]

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

Doubleclick function performed by keyboard key [SOLVED]

#1 Post by greengeek »

My elderly father has trouble with using a double click function. I have puppy set up so that most functions are single click, but unfortunately it seems that it is not possible to convert all double click functions to single click (due to gtk restraints etc) so I would like to find a way to make one key on the keyboard function as a double click button.

The most important requirement for doubleclick seems to be when he is trying to view his emails. The webmail client provided by his ISP requires a doubleclick to open each email.

I have found various posts which refer to the “mousekeys
Last edited by greengeek on Wed 21 Nov 2012, 08:17, edited 3 times in total.

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

#2 Post by greengeek »

OK, just for the record, it seems that I can use this function if I add a full size keyboard and do the following:

Press SHIFT and NUMLOCK togther (should hear "beep"),
Place cursor over the item I want to doubleclick,
Press the "+" key on the numeric keypad.

This works on Slacko5.3 without any other software changes or additions.

If I can find a way to change from the "+" key to say, the F9 key I will be happy. Then if I can find a way to trigger the mousekeys function on without needing the NUMLOCK key I will be ecstatic.

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

#3 Post by greengeek »

I got an idea from another post here:
http://www.murga-linux.com/puppy/viewtopic.php?t=76708

seaside suggested using the xdtool program which technosaurus made available here:
http://www.murga-linux.com/puppy/viewtopic.php?t=79573

I tinkered with it and it is quite easy to set up what I was looking for - when I press the F9 key it now behaves like a "doubleclick" function.

Here's how:

1) First I downloaded the xdotool program from the post above and put it into /usr/bin.

2) Then 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)

3) 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 to all the contributors on the listed posts. Very helpful.

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Doubleclick function performed by keyboard key [SOLVED]

#4 Post by ETP »

Hi greengeek,

You don’t now actually need the script. Change

Code: Select all

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

Code: Select all

<Key keycode="75">exec:xdotool click 1 click 1</Key>
Mapping to one key (F9) may cause problems if an application re-maps it and makes use of it. (Use a key-mask instead such as CTRL+F9 if you encounter this issue)
OR
If using a full sized keyboard with two windows (super) keys use the right hand one as follows. (Keep your paws off the left hand one as I have it bagged :wink: )

Code: Select all

<Key keycode="116">exec:xdotool click 1 click 1</Key>
There is more on this subject in my thread here:
http://www.murga-linux.com/puppy/viewtopic.php?t=81413
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

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

#5 Post by greengeek »

.
Awesome, thanks ETP. That simplifies it even further.

I decided not to use a keymask as it introduces an extra difficulty for my father - he would have to concentrate on two keys at once which is asking too much at the moment.

I will have to be cautious about what other apps might do with that key.

EDIT 1: I wonder if "SHIFT F9" has any meaning? He will probably have to master the shift key eventually. If it works that might be a suitable keymask if required.

EDIT 2:I have successfully activated the F9 as a doubleclick function and in order to test it I place the mousepointer over the trash folder and press the F9 key. The trash folder opens and is empty. Then, as ETP has suggested, I decided to try using a keymask so that instead of just pressing the F9 key, you have to press ALT and F9 together.

I opened the hidden file jwmrc etc as text and saw the keybindings like this:

Code: Select all

<Key mask="A" key="#">desktop#</Key>
<Key mask="A" key="F1">root:3</Key>
<Key mask="A" key="F2">window</Key>
so I added one in for “ALT F9“ by following those examples with a slight modification as follows:

Code: Select all

<Key mask="A" key="F9">exec:doubleclick_xdotool</Key>
(Then restarted the jwm)

That worked fine, so I thought I would try another modification by trying to use SHIFT F9 instead of ALT.

so I added one in for “SHIFT F9“ by following those examples with a slight modification as follows:

Code: Select all

<Key mask="S" key="F9">exec:doubleclick_xdotool</Key>
It DOES activate the SHIFT F9, but I don’t get the result I expect.

Now when I put the mousepointer over the trash folder and press the Shift F9 key I get the trash folder opening, but it’s not empty as it normally is - it seems to contain a cluster of items as follows:
Help directory
template directory
AppInfo.xml file
AppRun bash file
systemmsh.wav symlink


Then I tried “C

Post Reply