MouseGestureL

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
Pyonkichi
Posts: 113
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

27 Apr 2024, 03:31

@Azona77,
If your additional code is not much, I recommend using MG_User.ahk instead of the plugin. It can be opened by selecting "Edit User Extension Script" from the tray icon menu.
Azona77
Posts: 3
Joined: 02 Sep 2023, 10:17

Re: MouseGestureL

27 Apr 2024, 03:55

Pyonkichi wrote:
27 Apr 2024, 03:31
@Azona77,
If your additional code is not much, I recommend using MG_User.ahk instead of the plugin. It can be opened by selecting "Edit User Extension Script" from the tray icon menu.
Thank you so much~ It worked~
I simply pasted it into MG_User.ahk after line`Goto, MG_User_End`. Haven't found any issue~
User avatar
GollyJer
Posts: 71
Joined: 19 Sep 2015, 19:33
Contact:

Re: MouseGestureL

30 Apr 2024, 12:37

Pyonkichi wrote:
27 Apr 2024, 03:30
@GollyJer, Specify ahk_parent as the 1st param.
You can use MG_HWND as the target window handle.

Code: Select all

ControlSend, ahk_parent, {Ctrl Down}{Home}{Ctrl Up}, ahk_id %MG_HWND%
Thanks for the help @Pyonkichi. However, it still doesn't seem to be working.
Do you use Discord or vscode? Those are both examples of app where I'm having to physically click into the control before the scroll key commands will work.
Discord is the best example. If you activate any other app, then hover over discord and do the gesture, nothing happens. If you then click anywhere in a chat message and do the gesture, it works.

Thanks for any more insight you can provide. 👍
Ralf_Reddings200244
Posts: 121
Joined: 11 Mar 2023, 14:16

Re: MouseGestureL

20 May 2024, 09:24

@Pyonkichi
Is it possible to get a gesture like RB_LB_8_/RB_LB_8__ to fire when LB is released, rather than when RB is released, and then have MGL reset, as If I manually released RB and then held it back down again?

I was able to get RB_LB_8_ to fire when LB is released but MGL does not reset itself (last trail is still active) so I am not able to fire another gesture such as RB_LB_2_, without releasing RB

I have gestures that follow the following pattern

Code: Select all

MG_Gesture_RB_LB_8__:
MG_Gesture_RB_LB_2__:
MG_Gesture_RB_LB_4__:
MG_Gesture_RB_LB_6__:

MG_Gesture_RB_MB_8__:
MG_Gesture_RB_MB_2__:
MG_Gesture_RB_MB_4__:
MG_Gesture_RB_MB_6__:
...
Each time I want to trigger one of them, I have to make sure to release RB at the end, I would really to do away with this, and just have these gestures fire when I release the sub trigger LB.

This would also make it faster trigger other gestures as I am already holding RB down

Thanks.
User avatar
Pyonkichi
Posts: 113
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

22 May 2024, 11:12

@Ralf_Reddings200244,
The behavior that you want is the default. Other gestures you are using may be affecting the issue. So save the current Config folder and remove it, then restart MGL with default settings and add only two gestures for the test.

RB_LB_8_

Code: Select all

Default=ToolTip, Up
RB_LB_2_

Code: Select all

Default=ToolTip, Down
You can also check the current recognition status by enabling gesture logs.
logs.png
logs.png (9.56 KiB) Viewed 2061 times
Ralf_Reddings200244
Posts: 121
Joined: 11 Mar 2023, 14:16

Re: MouseGestureL

24 May 2024, 17:49

@Pyonkichi
Very strange, thank you for the conclusive answer, I will take your suggestion and take a closer look.
Ralf_Reddings200244
Posts: 121
Joined: 11 Mar 2023, 14:16

Re: MouseGestureL

08 Jun 2024, 20:15

@Pyonkichi
Is it possible to trigger a gesture like LB_, while the action script for gesture RB_ is running?

I am trying to create two gestures where I can pan and rotate the view in programmes like Photoshop fluidly. Essentially, being able to rotate the view, without needing to release "root", panning trigger

I would like to make it so that when I hold down Right click (RB_), panning is engaged and while RB_ is still active, its possible to add Left click (RB_LB_) which will disengage "panning" keys and perform rotation.

The standard AutoHotkey code for this idea is (lets say the key to pan is space and x is for rotation):

Code: Select all

~a::
	SendInput, {space down}{lbutton down}
	KeyWait, a
	SendInput, {lbutton up}{space up}
	return
a & f::
	SendInput, {space up}{lbutton up}				;first exit "panning" mode
	SendInput, {x down}{lbutton down}				;then engage keys for "rotation" mode
	KeyWait, f										
	SendInput, {lbutton up}{x up}						;On f up, exit "rotation" mode
	SendInput, {space down}{lbutton down}			;and re engage "panning" mode keys
	return
I recorded a little demonstration to show what it looks like in Photoshop.

I am having trouble implementing this idea in a clean MGL 1.40 environment. Here is what I have so far:
Image
I also tried a very basic test using mg_hold(), RB_:

Code: Select all

MG_CancelDefBehavior()
if (!MG_Hold())
	tooltip, RB_ Down
else
	tooltip, RB_ Up
RB_LB_:

Code: Select all

if (!MG_Hold())
	tooltip, RB_LB_ Down
else
	tooltip, RB_LB_ Up
The problem I am having seems to be that MGL will only let me trigger RB_LB if the current gesture is RB_ and not if its something like RB_8_ or RB_624.

I guess what I am trying to figure out is that is it possible to fire RB_LB_, no matter what the current gesture directions for RB_... is


I seem to going around in circles, any help or advice would be amazing
User avatar
Pyonkichi
Posts: 113
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

11 Jun 2024, 03:35

@Ralf_Reddings200244,
It is not possible in the current version. I've modified the code for testing. Download the test version from the link below and add new function to RB_ action.

https://ss1.xrea.com/pyonkichi.g1.xrea.com/archives/mgltest_20240611.zip

RB_:

Code: Select all

MG_SetBypass("LB")
ToolTip, RB_
RB_LB_:

Code: Select all

ToolTip, RB_LB_
Try it for a while. If there are no problems, it will be reflected in the next version.
Last edited by Pyonkichi on 14 Jun 2024, 11:07, edited 1 time in total.
Ralf_Reddings200244
Posts: 121
Joined: 11 Mar 2023, 14:16

Re: MouseGestureL

14 Jun 2024, 07:15

@Pyonkichi
Thanks for the answer, your solution looks to be exactly what I needed.

I was waiting for the weekend to get back to this issue as I have been busy with work.

I have tried to download the file you linked to but I keep getting this error:
Not Found
The requested URL was not found on this server.
I tried it under a VPN too, same issue.
User avatar
Pyonkichi
Posts: 113
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

14 Jun 2024, 11:09

@Ralf_Reddings200244, Sorry, it was wrong link. I've fixed it.
Ralf_Reddings200244
Posts: 121
Joined: 11 Mar 2023, 14:16

Re: MouseGestureL

14 Jun 2024, 14:15

@Pyonkichi

Okay I have it downloaded now, thanks! I will test it out, over the coming day. I will be sure to let you know of any problems.
Ralf_Reddings200244
Posts: 121
Joined: 11 Mar 2023, 14:16

Re: MouseGestureL

19 Jun 2024, 14:02

@Pyonkichi
Okay, I have been using it and experimenting with it for a few days and I thought I would report back. It does work as you intended, with one minor issue.

I have it set up like so, RB_:

Code: Select all

MG_SetBypass("LB")
if (!MG_Hold())
	tooltip, RB_ Down
else
	tooltip, RB_ Up
and for RB_LB_:

Code: Select all

ToolTip, RB_LB_ Down
keywait, lbutton
ToolTip, RB_LB_ Up
RB_ works, "RB_ Down" is printed on key down and "RB_ Up" on key up:

Image

Same with RB_LB_:

Image

The issue I mention occurs, if the cursor was dragged since right click action script was fired, and the current gesture is anything other than RB_, such as RB_4/RB_8. Then it becomes impossible to fire RB_LB_.

In this example, I fire RB_, then move the mouse so my gesture becomes something like RB_4/RB_8 and when I try to trigger gesture RB_LB_, it does not fire. You can see the hint RB_LB_ show but the ActionScript "RB_LB_ Down" does not print. It only works if I attempt to trigger it a second time by pressing left click, while right click is still down:

Image

I can fix this issue by setting "Detection start" in the GUI, to a very high number or the following:

Code: Select all

MG_ThresholdBackUp := MG_Threshold, MG_Threshold := 999999              ; backup current threshold value
ToolTip, RB_LB_ Down
keywait, lbutton
ToolTip, RB_LB_ Up
MG_Threshold := MG_ThresholdBackUp                                      ; on key up, restore threshold value

-
Having said that, with this set up I am not able to use AHKs keywait in RB_ like so, hence why I used MGLs mg_hold():

Code: Select all

MG_SetBypass("LB")
ToolTip, RB_LB_ Down
keywait, Rbutton
ToolTip, RB_LB_ Up


;if (!MG_Hold())
	;tooltip, RB_ Down
;else
	;tooltip, RB_ Up
but I can in RB_LB_:

Code: Select all

ToolTip, RB_LB_ Down
keywait, lbutton
ToolTip, RB_LB_ Up
Using keywait in RB_, makes it impossible to fire RB_LB_, I dont quite know why, I tried a bunch of things such as applying ~ prefix to RB_/LB trigger definitions but it did not work. Do you know why using keywait in RB_ makes it impossible to fire RB_LB_?
User avatar
Pyonkichi
Posts: 113
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

19 Jun 2024, 22:08

@Ralf_Reddings200244,
It's a simple bug, I didn't do a final check after modifying it to allow MG_SetBypass() to be called without parameter.
Please modify the code as follows:

MouseGestureL.ahk - line: 1216

Wrong:

Code: Select all

MG_BypassTrigger := btn
Corrected:

Code: Select all

MG_BypassTrigger := "_" btn "_"
Ralf_Reddings200244
Posts: 121
Joined: 11 Mar 2023, 14:16

Re: MouseGestureL

20 Jun 2024, 09:44

@Pyonkichi
Okay I can cofirm that fixed the issue. Thanks a lot for looking into this Pyonkichi.

Looking forward to the successor to version 1.40
a_riva
Posts: 5
Joined: 08 Nov 2021, 15:58

Re: MouseGestureL

21 Oct 2024, 12:27

Hello. Help me plz. I have many MG based on RB.
How can I make it so that when I press SHIFT and hold it, the recognition of right mouse button gestures is disabled and it works as usual mouse movement. and when I released the shift, gesture recognition worked again. I need it for PAN with RMB in CAD program.
User avatar
submeg
Posts: 346
Joined: 14 Apr 2017, 20:39
Contact:

Re: MouseGestureL

Today, 03:39

a_riva wrote:
21 Oct 2024, 12:27
Hello. Help me plz. I have many MG based on RB.
How can I make it so that when I press SHIFT and hold it, the recognition of right mouse button gestures is disabled and it works as usual mouse movement. and when I released the shift, gesture recognition worked again. I need it for PAN with RMB in CAD program.
@riva, do you want it to always be disabled in the CAD program, or only sometimes?

You can disable it based on the active program:
It can be used when you want to disable the default gestures triggered by the right button in a target such as a game, but want to assign the functions to the extended buttons.
If it is enabled, the target is excluded from the target group of the default gestures, and hook processing will not be performed except for the trigger buttons used for the target-specific gestures.
____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
a_riva
Posts: 5
Joined: 08 Nov 2021, 15:58

Re: MouseGestureL

Today, 08:09

@riva, do you want it to always be disabled in the CAD program, or only sometimes?
Only sometimes.
I want to have the possibility to disable just gestures assigned to RMB, by pressing and holding SHIFT button. When i release SHIFT btn, gestures must be enabled again. Sorry for my English)

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 109 guests