Use shortcut as mouse button replacement

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
piula
Posts: 4
Joined: 18 May 2021, 17:12

Use shortcut as mouse button replacement

Post by piula » 18 May 2021, 17:23

Hello,

the left mouse button of my notebook ain't working properly anymore so I thought I could use AutoHotkey to configure a keyboard button to behave exactly the same way as left mouse button.

I created this script:

Code: Select all

Appskey::
click Left Down ;click left mousebutton and hold
keywait, AppsKey ; wait until key is released. Double backtick because backtick needs to be escaped (with a backtick)
click Left Up ; release left mousebutton
return
I'm using the "menu" key as I usually don't need it and won't miss it.

It's basically working, but I have a problem with holding the key. I would expect it to just keep the mouse button clicked until I release the "menu" key. However instead, it keeps firing mouse-click events.

I have already tried several alternatives, e.g. using "AppsKey Down" and "AppsKey Up", but didn't succeed.

I would appreciate if someone could tell me what I'm doing wrong because as far as I understand the documentation, it should work :think:

Thanks!

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: Use shortcut as mouse button replacement

Post by mikeyww » 18 May 2021, 18:19

Code: Select all

AppsKey::LButton

piula
Posts: 4
Joined: 18 May 2021, 17:12

Re: Use shortcut as mouse button replacement

Post by piula » 20 May 2021, 04:47

Thanks, but this gives the same behavior. When I hold the key, it keeps clicking and after a while displays this message:

"71 hotkeys have been received in the last 1016ms."

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: Use shortcut as mouse button replacement

Post by mikeyww » 20 May 2021, 06:45

This is your entire script, and no other scripts are running?

piula
Posts: 4
Joined: 18 May 2021, 17:12

Re: Use shortcut as mouse button replacement

Post by piula » 20 May 2021, 09:41

Yes, it's the entire and only script.

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: Use shortcut as mouse button replacement

Post by mikeyww » 20 May 2021, 09:53

I wonder if you saved and reloaded the script. All this does is have AppsKey act like your mouse button.

piula
Posts: 4
Joined: 18 May 2021, 17:12

Re: Use shortcut as mouse button replacement

Post by piula » 21 May 2021, 12:45

I found the problem (but no solution yet): appearently, this hotkey mapping shows the bevahior due to me being connected to the Windows machine via an RDP connection. When I try the same script on a "real" Windows, it works as expected. Seems I have to live with that.

User avatar
mikeyww
Posts: 26851
Joined: 09 Sep 2014, 18:38

Re: Use shortcut as mouse button replacement

Post by mikeyww » 21 May 2021, 13:48

I don't use RDP, but there are lots of posts about it-- perhaps with some solutions there.

Kasper Denmark
Posts: 6
Joined: 20 Sep 2023, 14:42

Re: Use shortcut as mouse button replacement

Post by Kasper Denmark » 20 Sep 2023, 14:59

I have the same issue with the let mouse button not working on my laptop. But when i try a script with

PgDn::Lbutton

Clicking and doubleclicking works but I can not drag items for more than a few inches and when i release the PgDn (which i want to use) the item slips back again...

Any help would be appreciated

Post Reply

Return to “Ask for Help (v1)”