Page 1 of 1

Hotkey doesn't work

Posted: 30 Jun 2022, 21:18
by hemsith14_
Hey, why is the following hotkey doesn't work for me? I'm trying to simulate a middle button click with left button in chrome so I can scroll pages without using the wheel.

Code: Select all

^!LButton::
Send, {MButton down}
KeyWait, LButton
Send, {MButton up}
Return
Any ideas? I thought it should be a simple one. Thanks!

Re: Hotkey doesn't work

Posted: 30 Jun 2022, 22:26
by mikeyww

Code: Select all

^!LButton Up::
KeyWait, Ctrl
KeyWait, Alt
Click, M
Return

Re: Hotkey doesn't work

Posted: 30 Jun 2022, 22:36
by hemsith14_
It's not working the way I wanted it to

I want to hold LButton and simulate this as a hold of MButton so I can drag the page.

Re: Hotkey doesn't work

Posted: 30 Jun 2022, 22:58
by mikeyww
It worked in my test after I installed the Chrome extension for MButton.

You have written it as Ctrl+Alt+LButton. You can also try:

Code: Select all

LButton::MButton
or alter the earlier script to remove the modifiers.

Re: Hotkey doesn't work

Posted: 30 Jun 2022, 23:25
by hemsith14_
Maybe I wasn't clear enough,

What I want is to drag the page like when the middle button of the mouse is pressed, but do it with the following shortcut: ctrl + alt + LButton.

So, when I press the LButton I can hold it and drag through the page.

Re: Hotkey doesn't work

Posted: 01 Jul 2022, 06:14
by mikeyww
Your description is not clear, but my script worked, so I cannot add anything further. Others may have some additional ideas for you.

Re: Hotkey doesn't work

Posted: 01 Jul 2022, 06:24
by RussF
@hemsith14_, while following this thread, I too was confused.
hemsith14_ wrote: I'm trying to simulate a middle button click with left button in chrome
hemsith14_ wrote: I want to hold LButton and simulate this as a hold of MButton so I can drag the page.
hemsith14_ wrote: What I want is to drag the page like when the middle button of the mouse is pressed, but do it with the following shortcut: ctrl + alt + LButton.
hemsith14_ wrote: So, when I press the LButton I can hold it and drag through the page.
You've stated three times that you want to simulate MButton by pressing LButton, but then throw in that you want to do it using Ctrl-Alt-LButton. Which is it that you want - LButton alone or Ctrl-Alt-LButton?

Russ

Re: Hotkey doesn't work

Posted: 01 Jul 2022, 09:45
by hemsith14_
Press ctrl + alt + lbutton

Hold LButton

While LButton is being held, keep MButton held

That way, you can move through the window while using this shortcut and holding LButton, when LButton is released, stop until I press it again with the combination.

Re: Hotkey doesn't work

Posted: 01 Jul 2022, 10:09
by RussF
Ok, so...

Press Ctrl-Alt-LButton to activate MButton

Release Ctrl and Alt, but as long as LButton remains physically held down, continue to logically hold MButton down.

Upon physical release of LButton release MButton. Correct?

I played around with it for a while, but didn't have time to solve it. Unfortunately, I have to leave my workstation for a few hours, but hopefully someone with more experience can help in the meantime now that there is a clearer description of what you need.

Russ

Re: Hotkey doesn't work

Posted: 01 Jul 2022, 10:20
by hemsith14_
Yes, thanks Russ!

Re: Hotkey doesn't work

Posted: 01 Jul 2022, 11:42
by mikeyww
Your first script does that. Does it work when you use MButton manually? I had to install a Chrome extension to get scrolling here.

Nonetheless, I then had to use my script, which sent the button both down and up-- after release of modifiers-- because that was how the extension worked.

See :arrow: KeyHistory to understand what is happening with the keys.

Re: Hotkey doesn't work

Posted: 01 Jul 2022, 14:20
by hemsith14_
I was attempting to do that with my first script but it didn't work for some reason, it seems like it's pressing the MButton but then quickly releasing it.

It does work however, when I change the key wait to something like "W".

Re: Hotkey doesn't work

Posted: 01 Jul 2022, 14:32
by mikeyww
I do not know where W comes into play here, but if that works for you, then so be it. :)

Re: Hotkey doesn't work

Posted: 01 Jul 2022, 14:40
by hemsith14_
It doesn't I just used "W" in order to debug it, but I want to do it only by LButton, without W.