MouseGestureL

Post your working scripts, libraries and tools for AHK v1.1 and older
agustav3
Posts: 6
Joined: 21 Sep 2021, 07:11

Re: MouseGestureL

Post by agustav3 » 30 Sep 2021, 02:27

Hmm, I've tried that but for some reason it doesn't work on my computer and mouse. Does that command trigger when you release one of the mouse buttons?

Any other settings you might have change in order to make the command to work?

Thanks!

BR,
Andreas
Avastgard wrote:
29 Sep 2021, 09:38
Here you go:


image.png


This particular gesture opens notepad


image.png


Let me know if you have any questions I can answer.

Avastgard
Posts: 133
Joined: 30 Sep 2016, 21:54

Re: MouseGestureL

Post by Avastgard » 30 Sep 2021, 04:18

Could you post a screenshot of how your gestures tab looks like?

agustav3
Posts: 6
Joined: 21 Sep 2021, 07:11

Re: MouseGestureL

Post by agustav3 » 05 Oct 2021, 03:27

Hi, here's my setup:
image.png
image.png (139.37 KiB) Viewed 5182 times
Avastgard wrote:
30 Sep 2021, 04:18
Could you post a screenshot of how your gestures tab looks like?

Avastgard
Posts: 133
Joined: 30 Sep 2016, 21:54

Re: MouseGestureL

Post by Avastgard » 05 Oct 2021, 11:18

I don't see why it shouldn't work.

The way my script is set up, I hold RButton, hold LButton, move mouse to the specified direction and release any of the buttons to run notepad. You can't wait too long to release the buttons or you'll miss the recognition threshold and the gesture will not trigger the action.

If I were you I would use the "Remove last one step from current gesture" button in the Gestures tab until you have a gesture that is recognized and work my way up from there to pinpoint what step is causing the issue.

agustav3
Posts: 6
Joined: 21 Sep 2021, 07:11

Re: MouseGestureL

Post by agustav3 » 14 Oct 2021, 01:56

Hi again,

For some unknown reason the gestures started working :)
However, the reason that I wanted to use both mouse buttons as a trigger was that I wanted to avoid starting a gesture recognition when only the right mouse button is pressed. I'm using programming applications at work when I occasionally drag objects with the right mouse button pressed. With this setup, the normal functionality is disabled when pressing the right mouse button (since a gesture action is active). I thought a recognize action only started when both mouse button were pressed?

Hopefully you understand what I'm trying to explain, any idea of how to achieve this behavior?

Once again, thanks in advance!

BR,
Andreas
Avastgard wrote:
05 Oct 2021, 11:18
I don't see why it shouldn't work.

The way my script is set up, I hold RButton, hold LButton, move mouse to the specified direction and release any of the buttons to run notepad. You can't wait too long to release the buttons or you'll miss the recognition threshold and the gesture will not trigger the action.

If I were you I would use the "Remove last one step from current gesture" button in the Gestures tab until you have a gesture that is recognized and work my way up from there to pinpoint what step is causing the issue.

User avatar
Pyonkichi
Posts: 107
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

Post by Pyonkichi » 16 Oct 2021, 02:00

@agustav3,
You can define a new trigger that combines both mouse buttons.
You need to change the code in MG_Edit.ahk before creating the new trigger.

Line 2225 - before:

Code: Select all

	desc:=Trim(desc), name:=Trim(name), key:=RegExReplace(key,"\s","")
Line 2225 - modified:

Code: Select all

	desc:=Trim(desc), name:=Trim(name), key:=Trim(key)
(1) Create a trigger.
mgl02.jpg
mgl02.jpg (14.6 KiB) Viewed 5020 times
(2) Define the gestures with the new trigger.
mgl01.jpg
mgl01.jpg (67.01 KiB) Viewed 5020 times

tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: MouseGestureL

Post by tuzi » 26 Oct 2021, 22:54

When setting mgl to self-start, the working dir will change, causing the relative path used in MG_User.ahk to fail.


We can add SetWorkingDir, %A_LineFile%\..\ in MouseGestureL.ahk to solve this problem.

agustav3
Posts: 6
Joined: 21 Sep 2021, 07:11

Re: MouseGestureL

Post by agustav3 » 02 Nov 2021, 08:33

Works exactly how I wanted to! Big thanks!
Pyonkichi wrote:
16 Oct 2021, 02:00
@agustav3,
You can define a new trigger that combines both mouse buttons.
You need to change the code in MG_Edit.ahk before creating the new trigger.

Line 2225 - before:

Code: Select all

	desc:=Trim(desc), name:=Trim(name), key:=RegExReplace(key,"\s","")
Line 2225 - modified:

Code: Select all

	desc:=Trim(desc), name:=Trim(name), key:=Trim(key)
(1) Create a trigger.
mgl02.jpg

(2) Define the gestures with the new trigger.
mgl01.jpg

Epoch
Posts: 41
Joined: 04 Jun 2021, 11:09

Re: MouseGestureL

Post by Epoch » 25 Nov 2021, 20:13

Since Firefox addons do not allow gestures on every page for a while now, how could I simulate an “open link in a new background tab” by holding the right mouse button and drag the mouse downwards? The default shortcut is “control+Left click” over a link. The problem is, the script doesn’t take in account the link I’ve momentarily hovered over before started dragging downwards from so it can open it once the action is performed, but it expects to find a link at the end of it, which obviously is not how similar actions gestures usually work.

Avastgard
Posts: 133
Joined: 30 Sep 2016, 21:54

Re: MouseGestureL

Post by Avastgard » 26 Nov 2021, 05:21

Are you talking about an action that will open a link in a new tab, like middle clicking a link in Chrome?

Epoch
Posts: 41
Joined: 04 Jun 2021, 11:09

Re: MouseGestureL

Post by Epoch » 26 Nov 2021, 07:22

Avastgard wrote:
26 Nov 2021, 05:21
Are you talking about an action that will open a link in a new tab, like middle clicking a link in Chrome?
Well, I don't use Chrome but yes I suppose. Been using AHK for a while and while it's super useful for all kinds of things, it seems there are issues when it comes to mouse gestures initiated while holding the right mouse button (like sometimes disabling right clicking altogether).
MouseGestureL came to the rescue so I can now have gestures on Firefox, even on pages not allowed by Mozilla such as "new page" or Firefox addon pages (for whatever semi-absurd reason, probably the same it made them adopt Webextensions and made me start using forks - bit I digress...).
So yeah, I want holding Right mouse button then dragging the mouse down effectively sending "Control+Click" which I've technically set up successfully. The problem is, since I dragging the the mouse down, the cursor is not over the link anymore so there's nothing to open. Hope it makes sense? :)

Pretty sure this is relatively simple to pull off, I'd just leave a Firefox addon handle it but apart from the page limitations I've mentioned, it seems MouseGestureL disables gesture addons effect and you can't have it both ways.

Avastgard
Posts: 133
Joined: 30 Sep 2016, 21:54

Re: MouseGestureL

Post by Avastgard » 26 Nov 2021, 10:00

I guess you would need something to reset the mouse cursor to the original position and then send control + click. I have seen other scripts do this, but unfortunately it's beyond my knowledge.

Although I'm not sure I understand your problem. Using firefox 94.0.2 (64-bit) allows me to middle click a link and it'll open in a new tab, just like in Chrome. Isn't that what you need?

Epoch
Posts: 41
Joined: 04 Jun 2021, 11:09

Re: MouseGestureL

Post by Epoch » 26 Nov 2021, 10:35

Avastgard wrote:
26 Nov 2021, 10:00
I guess you would need something to reset the mouse cursor to the original position and then send control + click. I have seen other scripts do this, but unfortunately it's beyond my knowledge.
Ah so maybe it isn't as simple as I thought after all. I suppose pulling that off with just AHK (leaving MouseGestureL aside) doesn't help either, right? I am far from being an AHK expert but "recording" original position then getting back to it is within my knowledge. The problem is that this "recording", since it's part of the action, will also start once the gesture is completed which cancels the whole point. I need a "record link position/url when the gesture starts then once it's completed open the link either by control clicking or simply navigating to the recorded url" thingy.
Although I'm not sure I understand your problem. Using firefox 94.0.2 (64-bit) allows me to middle click a link and it'll open in a new tab, just like in Chrome. Isn't that what you need?
Well, not quite. Of course doing that with a dedicated mouse button or a shortcut is straightforward, I wouldn't even need AHK or Logitech Software as it's pretty much the default behaviour as you say. Not sure if I haven't been clear enough in my previous messages, maybe it's my fault but I've been trying to say I want to do that with a gesture.
I am used to doing that with a "RButton + then drag down" gesture while hovering over a link for ages and I was hoping AHK could help in not having to retrain muscle memory and/or waste another mouse button... ;)

User avatar
Pyonkichi
Posts: 107
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

Post by Pyonkichi » 27 Nov 2021, 01:51

@Epoch,
Call MG_Move() before sending a mouse click. You can add it by selecting "Move Cursor" in the action templates.
It is recommended to use "BlockInput, MouseMove" to ensure the operation.

Epoch
Posts: 41
Joined: 04 Jun 2021, 11:09

Re: MouseGestureL

Post by Epoch » 27 Nov 2021, 09:17

Pyonkichi wrote:
27 Nov 2021, 01:51
@Epoch,
Call MG_Move() before sending a mouse click. You can add it by selecting "Move Cursor" in the action templates.
It is recommended to use "BlockInput, MouseMove" to ensure the operation.
Thanks for the reply and your good work with the script. Ah MG_Move() was seemingly the missing link in order to make sure the cursor returns to the original position so it clicks the link.
However, it doesn't seem to work for some reason. After completing the gesture, the cursor does return to the link position, however instead of clicking, context menu opens.
Seems like the code isn't properly executed and I get the default right click behaviour instead? (Firefox context menu opening up). Here's my script:

Code: Select all

sendinput, {Ctrl down}
MG_Move()
BlockInput, MouseMove
MG_Click("LB")
sendinput, {Ctrl up}
I've also tried adding various sleep intervals between the lines as well as putting MG_Move() at the start but it doesn't seem to make a difference.

Btw, any ideas why with some gestures the action names appear and with some they don't despite the fact I made sure to include them (commented) in the beginning of the script and what's with the ▯ appearing there as well?
Last edited by Epoch on 27 Nov 2021, 11:23, edited 1 time in total.

User avatar
Pyonkichi
Posts: 107
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

Post by Pyonkichi » 27 Nov 2021, 10:46

@Epoch, here

Code: Select all

BlockInput, MouseMove
MG_Move()
Send, {Control Down}
MG_Click("LB")
Send, {Control Up}
BlockInput, MouseMoveOff

Epoch
Posts: 41
Joined: 04 Jun 2021, 11:09

Re: MouseGestureL

Post by Epoch » 27 Nov 2021, 11:42

Pyonkichi wrote:
27 Nov 2021, 10:46
@Epoch, here

Code: Select all

BlockInput, MouseMove
MG_Move()
Send, {Control Down}
MG_Click("LB")
Send, {Control Up}
BlockInput, MouseMoveOff
I was about to say it doesn't work either but I've decided to test with a "clean" MouseGestureL instance (unzipped the script and ran from a new folder) and it does work there. Strangely enough, gesture name appears as well (see edit in my previous post). So thanks again!
Not sure what's wrong with my main instance but it looks like I'll have to start adding gestures and actions from scratch in the new one... :think:

hellen_dorandt89
Posts: 25
Joined: 05 Jan 2022, 08:25

Re: MouseGestureL

Post by hellen_dorandt89 » 09 Jan 2022, 22:25

They were always lacking in one aspect or another. For example
  • Only mouse buttons can be set as triggers (No keyboard keys allowed)
  • Not allowed to use two triggers as part of a complex combination
  • Cant directly edit the configuration file and must rely on GUI window
  • No way of performing button holding such as Hold A down and then release A when trigger is released
  • No built functions like like MG_Abort(). Quite possibly one of the best features of MGL
  • Used Autohotkey as its Engine, So still able use commands such as WinMenu ControlClick ` etc
I can go on lol. I can do my work much faster and comfortably due to this software. I was able to get up and running by using this thread, allot of the question I had many others have already asked before me, which was extremely useful.

I know you have been asked before but none the less I am compelled to also ask. Please consider taking donation, even if its just to fund future maintainability of this project.

Thanks allot for your effort

User avatar
Pyonkichi
Posts: 107
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

Post by Pyonkichi » 11 Jan 2022, 01:18

Thanks. I will consider about the donation.

User avatar
kunkel321
Posts: 975
Joined: 30 Nov 2015, 21:19

Re: MouseGestureL

Post by kunkel321 » 23 Jan 2022, 16:28

Accidental ignoring on desktop?
Hey thanks for sharing your amazing app -- it's become indispensable to me!

Question: I recently got a new laptop and put MGL on it. The triggers don't seem to work on my Windows Desktop though... No blue line and no arrow indicators. (It does work in various windows though.)

In the Targets tab, at the top of the tree is "Ignored Targets." It doesn't seem to have any items in the list though... Does anyone have other ideas of what setting might affect this? Thanks.

Actually, I'll post a tip too:
Context menu not lining up on second monitor?
I found that, when I had MGL running, if I right clicked anything on my second monitor, the context menu would pop up way over to the far side of the monitor. It ended up being a Windows Scaling glitch. I had my main laptop monitor set for 125%, but the external monitor was at 100%. This caused problems with several apps. I learned the fix on a Rainmeter forum post here https://forum.rainmeter.net/viewtopic.php?t=22272
ste(phen|ve) kunkel

Post Reply

Return to “Scripts and Functions (v1)”