MouseGestureL

Post your working scripts, libraries and tools for AHK v1.1 and older
Epoch
Posts: 41
Joined: 04 Jun 2021, 11:09

Re: MouseGestureL

Post by Epoch » 07 Feb 2022, 13:24

Running MouseGestureL conflicts with Foxygestures on Firefox/Waterfox i.e it completely disables the actions of the addon. Which I guess it's normal. Is there any way I could possibly have MouseGestureL letting Foxygestures taking care of some gestures (the ones for simple tasks), then taking over for some gestures attached in more advanced actions you can't pull off with a browser addon? I've noticed you can set toggling shortcuts, but ideally I'd want to be able to execute Foxygesture gestures at will, without having to press key combinations to turn on/off the script.

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

Re: MouseGestureL

Post by Pyonkichi » 11 Feb 2022, 20:45

Epoch wrote:
07 Feb 2022, 13:24
Running MouseGestureL conflicts with Foxygestures on Firefox/Waterfox i.e it completely disables the actions of the addon. Which I guess it's normal. Is there any way I could possibly have MouseGestureL letting Foxygestures taking care of some gestures (the ones for simple tasks), then taking over for some gestures attached in more advanced actions you can't pull off with a browser addon? I've noticed you can set toggling shortcuts, but ideally I'd want to be able to execute Foxygesture gestures at will, without having to press key combinations to turn on/off the script.
Both MGL and browser gestures cannot be enabled if you use same trigger button. AHK processes mouse events before the browsers and does not pass the events to the browsers.
If you want to completely disable the MGL gestures when the browsers are activated, put the browsers on the ignored targets. You don't have to manually switch between disabling MGL.

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

Re: MouseGestureL

Post by Epoch » 12 Feb 2022, 13:25

Pyonkichi wrote:
11 Feb 2022, 20:45
Epoch wrote:
07 Feb 2022, 13:24
Running MouseGestureL conflicts with Foxygestures on Firefox/Waterfox i.e it completely disables the actions of the addon. Which I guess it's normal. Is there any way I could possibly have MouseGestureL letting Foxygestures taking care of some gestures (the ones for simple tasks), then taking over for some gestures attached in more advanced actions you can't pull off with a browser addon? I've noticed you can set toggling shortcuts, but ideally I'd want to be able to execute Foxygesture gestures at will, without having to press key combinations to turn on/off the script.
If you want to completely disable the MGL gestures when the browsers are activated, put the browsers on the ignored targets. You don't have to manually switch between disabling MGL.
But I don't want that. I'd like to use MGL but only for certain gestures, for others (not set on MGL), I'd like to let a browser addon handle that. But from what you say I understand this isn't possible and you can't have it both ways.
The reason I'd like that in the first place is because replicating browser addon gestures on MGL sometimes have weird side-effects I am not able to troubleshoot. For example, I've set it to cycle between tabs while holding right click and using the mouse wheel (a pretty standard thing):

RB_WU_

Code: Select all

;Previous Tab
Send, ^{PgUp} ; Firefox shortcut for previous tab
return
RB_WD_

Code: Select all

;Next Tab
Send, ^{PgDn} ; Firefox shortcut for next tab
return
Now, for a reason I can't understand, setting MGL to use the wheel to do that, sometimes results in closing the tab instead which is a problem. The gesture I've set for closing tabs is:
RB_L_

Code: Select all

;Close Tab
Send, ^w
I've also tried attaching Control-Tab (next) and Control-Shift Tab (previous) shortcuts to those wheel gestures (which achieve the same thing), but I get the same problem, occasionally, a tab will close. Any ideas why this is happening?

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

Re: MouseGestureL

Post by Pyonkichi » 13 Feb 2022, 00:07

@Epoch, As far as I can see your code, it should work fine. You may need to create a clean MGL configuration for troubleshooting.

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

Re: MouseGestureL

Post by Epoch » 20 Feb 2022, 10:13

Pyonkichi wrote:
13 Feb 2022, 00:07
@Epoch, As far as I can see your code, it should work fine. You may need to create a clean MGL configuration for troubleshooting.

I've stopped using my current MouseGestureL, unzipped it in a new folder and started using that, not sure if you meant doing that. I've setup my gestures again from scratch (which took some time...) and eventually the same issue reappeared. Tabs will mysteriously close when I try to cycle between them by using the wheel.
Not all the time, at seemingly random moments I cannot troubleshoot when or why. If there's not something wrong with my recognition settings and it's not a bug, I really don't know what's going on. These are the recognition settings that seem to make the script behave as I'd like to btw, apart from this problem of course.

Image

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

Re: MouseGestureL

Post by Pyonkichi » 21 Feb 2022, 02:06

@Epoch,
Sorry, my explanation was insufficient. I guess the cause of the issue is another gesture you set. So, I suggested registering only RB_WU_ and RB_WD_ first, adding other gestures one by one, and seeing which one is the problem.
The recognition settings seem to be fine.

Tiboru
Posts: 7
Joined: 12 Aug 2021, 09:38

Re: MouseGestureL

Post by Tiboru » 15 May 2022, 09:11

The arrows are displayed incorrectly - in the interface and hints.

arrows.png
arrows.png (6.47 KiB) Viewed 3223 times

Would it be more correct to use the character codes from the 'Private Use Area'?

After that, everything is displayed correctly
arrows_ok.png
arrows_ok.png (7.21 KiB) Viewed 3139 times

TY for the great script.
Last edited by Tiboru on 17 May 2022, 02:07, edited 1 time in total.

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

Re: MouseGestureL

Post by Epoch » 16 May 2022, 19:05

Tiboru wrote:
15 May 2022, 09:11
The arrows are displayed incorrectly - in the interface and hints.


arrows.png


Would it be more correct to use the character codes from the 'Private Use Area'?

After that, everything is displayed correctly

TY for the great script.
Hi, came to the thread to ask about several things, including the problem you had too. Finding the solution already waiting was pretty cool, so thanks for that. Initially changing the lines you've mentioned on "MG_Edit" replaced everything with weird symbols in the settings menu,
but it's quite possible that was a result of possible mistakes during replacing. I restored the initial file I had taken a backup of, in order to start from scratch, and it seemed like the arrow issue was fixed anyway so I left it there without any changes.
However, today the script complained with an error message popup about "Middle Click Gesture" or something, so I've tried editing the "MG_Edit" again, replacing the lines you've suggested.
No weird symbols this time which confirms my assumption about a mistake during the first time. Let's see how it goes. Cheers!
Last edited by Epoch on 17 May 2022, 12:23, edited 3 times in total.

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

Re: MouseGestureL

Post by Epoch » 16 May 2022, 19:42

Hi and thanks for the great script once again Pyonkichi. Since I use it a lot, I've got a few questions:

1. I was never able to get to the bottom of the RB_L_ issue, starting with a new config didn't help as I've said before. So I replaced the "close tab" action with a more...harmless one and then I kept getting that at random times. Needless to say, I've ended up ditching the gesture altogether... I've never got t a similar behaviour with any other gesture. Maybe there's really a bug you could look into?

2. Sometimes the script will seemingly conflict with actions on my main, master AHK script. Restarting both solves the issue but I would like to ask, what would you recommend as the proper way to do so? I am using this to restart both with one hotkey:

Code: Select all

Run C:\Users\....\...\MouseGestureL\MGLahk139\MouseGestureL.ahk
reload
Return
along with putting

Code: Select all

#SingleInstance Force
on "MousegestureL" but it kinda looks like a "hacky" workaround to me, maybe there's a better way?

3. I've recently found a way to replicate running an old Firegesture which would google search for a given term, only returning results from the site currently open. I was used in forming a "G" gesture with the mouse on Firegestures and I can't seem to be able to replicate it.
I can see the script registering mouse movement, but as soon as I reach to the final part, the horizontal line at the end, the RB_R gesture seemingly intervenes, canceling the previous movement into itself. Any way to make the script interpret the final "right" movement as the last part of the G gesture I am trying to do? I've tried playing with the "timeout" settings but it only made things worse, causing problems with other gestures too...

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

Re: MouseGestureL

Post by Pyonkichi » 19 May 2022, 10:57

Epoch wrote:
12 Feb 2022, 13:25
Pyonkichi wrote:
11 Feb 2022, 20:45
Epoch wrote:
07 Feb 2022, 13:24
Running MouseGestureL conflicts with Foxygestures on Firefox/Waterfox i.e it completely disables the actions of the addon. Which I guess it's normal. Is there any way I could possibly have MouseGestureL letting Foxygestures taking care of some gestures (the ones for simple tasks), then taking over for some gestures attached in more advanced actions you can't pull off with a browser addon? I've noticed you can set toggling shortcuts, but ideally I'd want to be able to execute Foxygesture gestures at will, without having to press key combinations to turn on/off the script.
If you want to completely disable the MGL gestures when the browsers are activated, put the browsers on the ignored targets. You don't have to manually switch between disabling MGL.
But I don't want that. I'd like to use MGL but only for certain gestures, for others (not set on MGL), I'd like to let a browser addon handle that. But from what you say I understand this isn't possible and you can't have it both ways.
The reason I'd like that in the first place is because replicating browser addon gestures on MGL sometimes have weird side-effects I am not able to troubleshoot. For example, I've set it to cycle between tabs while holding right click and using the mouse wheel (a pretty standard thing):

RB_WU_

Code: Select all

;Previous Tab
Send, ^{PgUp} ; Firefox shortcut for previous tab
return
RB_WD_

Code: Select all

;Next Tab
Send, ^{PgDn} ; Firefox shortcut for next tab
return
Now, for a reason I can't understand, setting MGL to use the wheel to do that, sometimes results in closing the tab instead which is a problem. The gesture I've set for closing tabs is:
RB_L_

Code: Select all

;Close Tab
Send, ^w
I've also tried attaching Control-Tab (next) and Control-Shift Tab (previous) shortcuts to those wheel gestures (which achieve the same thing), but I get the same problem, occasionally, a tab will close. Any ideas why this is happening?

Try this:

RB_L_

Code: Select all

;Close Tab
if (MG_IsFirstAction()) {
	Send, ^w
}

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

Re: MouseGestureL

Post by Epoch » 20 May 2022, 11:26

Pyonkichi wrote:
19 May 2022, 10:57
Epoch wrote:
12 Feb 2022, 13:25
Pyonkichi wrote:
11 Feb 2022, 20:45
Epoch wrote:
07 Feb 2022, 13:24
Running MouseGestureL conflicts with Foxygestures on Firefox/Waterfox i.e it completely disables the actions of the addon. Which I guess it's normal. Is there any way I could possibly have MouseGestureL letting Foxygestures taking care of some gestures (the ones for simple tasks), then taking over for some gestures attached in more advanced actions you can't pull off with a browser addon? I've noticed you can set toggling shortcuts, but ideally I'd want to be able to execute Foxygesture gestures at will, without having to press key combinations to turn on/off the script.
If you want to completely disable the MGL gestures when the browsers are activated, put the browsers on the ignored targets. You don't have to manually switch between disabling MGL.
But I don't want that. I'd like to use MGL but only for certain gestures, for others (not set on MGL), I'd like to let a browser addon handle that. But from what you say I understand this isn't possible and you can't have it both ways.
The reason I'd like that in the first place is because replicating browser addon gestures on MGL sometimes have weird side-effects I am not able to troubleshoot. For example, I've set it to cycle between tabs while holding right click and using the mouse wheel (a pretty standard thing):

RB_WU_

Code: Select all

;Previous Tab
Send, ^{PgUp} ; Firefox shortcut for previous tab
return
RB_WD_

Code: Select all

;Next Tab
Send, ^{PgDn} ; Firefox shortcut for next tab
return
Now, for a reason I can't understand, setting MGL to use the wheel to do that, sometimes results in closing the tab instead which is a problem. The gesture I've set for closing tabs is:
RB_L_

Code: Select all

;Close Tab
Send, ^w
I've also tried attaching Control-Tab (next) and Control-Shift Tab (previous) shortcuts to those wheel gestures (which achieve the same thing), but I get the same problem, occasionally, a tab will close. Any ideas why this is happening?

Try this:

RB_

Code: Select all

flgWheel:=false
RB_WU_

Code: Select all

;Previous Tab
Send, ^{PgUp} ; Firefox shortcut for previous tab
flgWheel:=true
RB_WD_

Code: Select all

;Next Tab
Send, ^{PgDn} ; Firefox shortcut for next tab
flgWheel:=true
RB_L_

Code: Select all

;Close Tab
if (!flgWheel) {
	Send, ^w
}
Thanks for the heads up! I've been trying the fix you've posted yesterday for a few hours and I haven't got any unwanted "RB_L_" gestures when using the wheel so far, wonder how the fix works behind the scenes.
Is the one you've recently edit it with a better approach?

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

Re: MouseGestureL

Post by Pyonkichi » 20 May 2022, 20:44

Epoch wrote:
20 May 2022, 11:26
Thanks for the heads up! I've been trying the fix you've posted yesterday for a few hours and I haven't got any unwanted "RB_L_" gestures when using the wheel so far, wonder how the fix works behind the scenes.
Is the one you've recently edit it with a better approach?
After the first post, I remembered implementing that function in a recent version. Both methods give similar results, but the latter is better because it requires only one change. It can be added from the action template "Execute if no other action has been fired".

I guess you have a habit of moving the cursor after rotating the wheel. The gesture recognition state returns to "RB_" after rotating the wheel, so if you move the cursor to the left before releasing the right button, it will be recognized as a "RB_L" gesture. (See "Continuation motion type gesture" in Help "Advanced usage")

kenji
Posts: 16
Joined: 08 Nov 2021, 03:15

Re: MouseGestureL

Post by kenji » 21 May 2022, 00:33

i don't know that much i will have to read the documentation and all pages of this forum to understand it fully, but in the meantime can you please help with this -

i want to perform smiliar thing to - swiping with three fingers on touch pad to switch application
by this method - hold wheel down ( starts displying all alt-tab windows) swiping left and right & up and down moves the selection and releasing the wheel select the selection .

is this feasible ?

or are you using some other method to achive this ? please can you share ?

will it be rude of me to ask you of all of you mousegestureL settings and setups. as i would like to see which gestures are you using and implement it in mine .

and thank you for this program.

kenji
Posts: 16
Joined: 08 Nov 2021, 03:15

Re: MouseGestureL

Post by kenji » 22 May 2022, 05:53

is there a way to achieve this ...
Edge and corner recognition. but i want a modified version. where when cursor reaches border of screen and when futher cursor is pressed against that border then an action of that gesture should execute. so inorder to still maintain the normal behavior of elements that are at the border of the screen like - scrollbar and many other elements.

loveqianool
Posts: 2
Joined: 23 May 2022, 08:30

Re: MouseGestureL

Post by loveqianool » 23 May 2022, 08:31

Can you add an ignore target based on the program path
For example, E:\Games\Steam

kenji
Posts: 16
Joined: 08 Nov 2021, 03:15

Re: MouseGestureL

Post by kenji » 23 May 2022, 21:03

loveqianool wrote:
23 May 2022, 08:31
Can you add an ignore target based on the program path
For example, E:\Games\Steam
Go to Targets>ignored Targets and in the Type select File Name and use Helper or enter the application name in the value area like - steam.exe this will block any gesture from triggering while steam application is in front.

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

Re: MouseGestureL

Post by Pyonkichi » 27 May 2022, 02:32

@loveqianool,
Use Custom Condition:

Code: Select all

InStr(MG_GetExeName(MG_HWND, true), "E:\Games\Steam")==1

loveqianool
Posts: 2
Joined: 23 May 2022, 08:30

Re: MouseGestureL

Post by loveqianool » 27 May 2022, 06:37

@kenji
@Pyonkichi
Thank you

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

MouseGestureL.ahk v1.40

Post by Pyonkichi » 22 Jun 2022, 07:01

MouseGestureL.ahk v1.40
  • Added "Move Window" to the action templates.
  • Added functions MG_PostInit() and ME_PostInit() for user-defined processing that are called after script initialization is complete.
  • (If you place them in the user-defined functions section in MG_User.ahk, MG_PostInit() will be called after MouseGestureL.ahk has been initialized, and ME_PostInit() will be called after MG_Edit.ahk has been initialized.)
  • Fixed a bug that button press event itself occurs when button press type gesture (including wheel rotation) is input after calling MG_SaveGesture().
  • Fixed a bug that MG_ActivatePrevWin() may not activate the previous active window.
  • Corrected detailed behavior of configuration dialog box.
  • Updated attached AutoHotkey version to v1.1.34.03.
Download:
 
Last edited by Pyonkichi on 28 Jun 2022, 10:52, edited 1 time in total.

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

Re: MouseGestureL

Post by kunkel321 » 26 Jun 2022, 12:28

loveqianool wrote:
27 May 2022, 06:37
@kenji
@Pyonkichi
Thank you
Thanks from me also. This is just what I needed, and it seems to work as expected.
ste(phen|ve) kunkel

Post Reply

Return to “Scripts and Functions (v1)”