Use Windows key to modify "mouseclick" type?

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

Use Windows key to modify "mouseclick" type?

#1 Post by greengeek »

Is it possible to use the Windows key to modify a mouseclick?

eg: say my rightclick button is broken, could I hold the Windows key at the same time as doing a 'leftclick' and have it issue a rightclick? (using xdotool or similar?)

Or is the Windows key only able to be used to modify keyboard strokes?

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

#2 Post by greengeek »

Just to add some links as I stumble across them:

java seems able to do this:
http://www.leepoint.net/notes-java/GUI- ... ttons.html

Browser plugin?
https://developer.mozilla.org/en-US/doc ... MouseEvent

This site includes a sample of how to do html detection of mouseclick+meta key:
http://www.w3schools.com/jsref/tryit.as ... nt_metakey
(problem - it successfully detects the metakey of the attached keyboard on my tablet but not the metakey that is on the front of the tablet - even though xev almost sees them as the same event)

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

#3 Post by greengeek »

To be honest I think the easiest way to use the Windows key to change the click type is to forget the mouse completely and just use xdotool to generate the click directly when the Windows key is pressed. I tried it here

Seems to work, but I am still interested if anyone can suggest how to modify a mouseclick by superimposing the windows key, as it could then modify a leftclick, centerclick or rightclick, rather than just one.

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

Use Windows key to modify "mouseclick" type?

#4 Post by ETP »

Hi greengeek,

I think that you are on the right track using a script with xdotool to generate the click but you need 3 scripts in conjunction with masks. (Modifier keys. - Ctrl, Alt & Shift)

Something along the following lines should work:

Code: Select all

<Key mask="C" key=Key keycode="115">exec:leftclick</Key>
<Key keycode="115">exec:middleclick</Key>
<Key mask="A" key=Key keycode="115">exec:rightclick</Key>
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 »

Thanks ETP.
The problem I am having is that I am using this method on a tablet device that has a Windows (meta) key on its front panel, but no other keyboard keys at all (except what I can get onscreen via xvkbd, but that is no use for this particular "control function" issue).

Without having ctrl or alt keys I am severely limited in what I can do. I could of course add a usb keyboard but that is bulky - I thought maybe I would add a small fingermouse - and then extend its ability to control the tablet by modifying each keyclick by superimposing the meta key, which would in theory give me a six button mouse...

Post Reply