MouseGestureL

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

Re: MouseGestureL

Post by Pyonkichi » 09 Apr 2021, 01:25

@deama, If you don't use the right drag very often in Explorer, delete the sub target of "Explorer" named "Icon".

daniel
Posts: 17
Joined: 23 May 2016, 22:41

Re: MouseGestureL

Post by daniel » 09 Apr 2021, 11:58

Can I use a modifier like shift or control with MouseGestureL to differentiate between otherwise equal mouse gestures?

For example, if I I have R (right mouse gesture) mapped to reload a webpage, can I map it so that shift + R (right mouse gesture) sends back instead of reload?

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

Re: MouseGestureL

Post by Pyonkichi » 10 Apr 2021, 21:45

@daniel, There are three ways.

1. Create a new trigger for the "+RButton". If you use this way, the default trigger of RB has to be modified to "RButton" from "*RButton".
2. Create another target for the Shift+RB. The new target has to include the Custom Condition defines "GetKeyState("Shift")".
3. Branch the action script by "if" statement like:

Code: Select all

if (GetKeyState("Shift")) {
	tooltip, Shift + RB
} else {
	tooltip, RB
}

daniel
Posts: 17
Joined: 23 May 2016, 22:41

Re: MouseGestureL

Post by daniel » 11 Apr 2021, 06:49

Thank you very much, Pyonkichi.

Alan_Breaker
Posts: 3
Joined: 14 Apr 2021, 04:07

Re: MouseGestureL

Post by Alan_Breaker » 15 Apr 2021, 02:30

Hi,Pyonkichi. I'm new here.
MGL is very powerful and stable, and your work is great.

Here I want to achieve the following functions:

1. Select with the left button. After selecting the content, before lifting the left button, press the right mouse button to complete the copy operation, and the right-click menu will not pop up after releasing the right button.

2. Associated with the above action, if you use the first step to copy the content, click the right mouse button to complete the paste operation, and the right-click menu will not pop up after releasing the right button.Otherwise, clicking the right mouse button is the default function, and a right-click menu will pop up.

If someone can share how to use the mouse to quickly copy and paste, it will be of great help to me.

Assign this to RB__.

Code: Select all

if (GetKeyState("LButton", "P")) {
	SendInput ^c
}
else
{
	MG_WinActivate()
}
Assign this to RB__RB__.

Code: Select all

; I did not implement this feature

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

Re: MouseGestureL

Post by Pyonkichi » 17 Apr 2021, 22:14

@Alan_Breaker, There are restrictions, but this may work for your needs.

Code: Select all

if (GetKeyState("LButton", "P")) {
	;Send, {LButton Up}
	Send, ^c
	flgCopied := true
}
else {
	if (flgCopied) {
		Send, ^v
	} else {
		Send, {RButton Up}
	}
	flgCopied := false
}
Ctrl + C does not work while mouse button is pressed on the Windows specification. I tried to solve this issue by adding "Send, {LButton Up}" before sending Ctrl + C, but the selection of the strings are released when the left button is released.
So this only works if you select the strings by mouse dragging and click the right button before releasing the left button.

Alan_Breaker
Posts: 3
Joined: 14 Apr 2021, 04:07

Re: MouseGestureL

Post by Alan_Breaker » 18 Apr 2021, 21:50

Pyonkichi wrote:
17 Apr 2021, 22:14
@Alan_Breaker, There are restrictions, but this may work for your needs.

Code: Select all

if (GetKeyState("LButton", "P")) {
	;Send, {LButton Up}
	Send, ^c
	flgCopied := true
}
else {
	if (flgCopied) {
		Send, ^v
	} else {
		Send, {RButton Up}
	}
	flgCopied := false
}
Ctrl + C does not work while mouse button is pressed on the Windows specification. I tried to solve this issue by adding "Send, {LButton Up}" before sending Ctrl + C, but the selection of the strings are released when the left button is released.
So this only works if you select the strings by mouse dragging and click the right button before releasing the left button.
Thank you for your reply Pyonkichi.
Yes, I also found this problem, and in some cases I could not copy successfully. I thought it was the imperfection of the code I wrote.

I tested this code and it works great!
When I select a string by dragging with the mouse, and then click the right button before releasing the left button, the right-click menu of the window pops up.
Is there a way to not pop up the right-click menu of the window when copying and pasting?

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

Re: MouseGestureL

Post by Pyonkichi » 18 Apr 2021, 22:58

@Alan_Breaker, My script must be assigned to RB__, not RB_. Did you do that?

Alan_Breaker
Posts: 3
Joined: 14 Apr 2021, 04:07

Re: MouseGestureL

Post by Alan_Breaker » 19 Apr 2021, 00:31

@Pyonkichi
Okay. Thank you for your reply.
But I found that the right mouse button cannot be used in some windows, for example: Explorer.

In addition, I have a small problem here. When I place the mouse on the taskbar, I scroll the mouse wheel to switch between virtual desktops.

Assign this to WU_.

Code: Select all

;Ctrl+Win+Left
Send, #^{Left}
Assign this to WD_

Code: Select all

;Ctrl+Win+Right
Send, #^{Right}

But after switching the virtual desktop, sometimes the Ctrl key is kept pressed, and I have to manually press the Ctrl key again to restore it.
This also happened when using the AHK script I wrote, but I didn't find a solution.

Mika_erdo
Posts: 41
Joined: 30 Jul 2020, 17:23

Re: MouseGestureL

Post by Mika_erdo » 21 Apr 2021, 09:18

@Pyonkichi
Any idea how I can toggle suspend status of another script via MGL?
In a standard single line AHK scrip, the code below will suspend the running script called Example1.ahk

Code: Select all

2::
PostMessage, 0x111, 65305,,, Example1.ahk - AutoHotkey 
Return
Using the same code above in MGl does nothing, I am wondering how can one suspend other scripts through MGL. Thanks!



gw9PkEkw7X.png
gw9PkEkw7X.png (11.49 KiB) Viewed 3660 times

maxsubs
Posts: 3
Joined: 25 May 2021, 09:18

Re: MouseGestureL

Post by maxsubs » 25 May 2021, 09:45

hey guys! I'm new with MouseGestureL.

I have a mouse with several buttons and I have assigned one of them to Launch_App2. I have called that button as "8" in MG and I want to use it as a media control gesture button:
Press > play/pause
Press+mouse up > volume up
Press+mouse down > volume down
Press+mouse left > previous song
Press+mouse right > next song

I also want the upper-left volume dialog to appear while changing volume. And for that this is my config:

Code: Select all

MG_Gesture_8_:
	if (!MG_IsExDefault()) {
		;Press Media_Play_Pause
		Send, {Media_Play_Pause}
	}
return

MG_GetAction_8_:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Media_Play_Pause"
	}
return

MG_Gesture_8_U:
	if (!MG_IsExDefault()) {
		;Press Volume_Up
		Send, {Volume_Up}
		;Sound Volume
		SoundSet, +5, MASTER, VOLUME
	}
return

MG_GetAction_8_U:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Volume_Up"
	}
return

MG_Gesture_8_D:
	if (!MG_IsExDefault()) {
		;Press Volume_Down
		Send, {Volume_Down}
		;Sound Volume
		SoundSet, -5, MASTER, VOLUME
	}
return

MG_GetAction_8_D:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Volume_Down"
	}
return

MG_Gesture_8_L_:
	if (!MG_IsExDefault()) {
		;Press Media_Prev
		Send, {Media_Prev}
	}
return

MG_GetAction_8_L_:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Media_Prev"
	}
return

MG_Gesture_8_R_:
	if (!MG_IsExDefault()) {
		;Press Media_Next
		Send, {Media_Next}
	}
return

MG_GetAction_8_R_:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Media_Next"
	}
return
But I have encountered two problems:
1 - While changing volume up/down the cursor starts to move and once it hits the upper/buttom edge volume can't no longer change. Is there a way, once I press "8" button and start moving the mouse up/down, to stop cursor from changing its position? so I can go volume up/down as much as I want.
2 - since the "8" button is assigned to play/stop every time I press to start some of the 4 gestures it also plays/pause. Is there a way to only play/pause if I don't do any gesture while pressing it?

Thanks a lot!
Last edited by maxsubs on 25 May 2021, 10:01, edited 1 time in total.

Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Re: MouseGestureL

Post by Antony » 25 May 2021, 09:55

Hello @Pyonkichi,
For a long I have been looking for a tool able to implement pie-menus into 3D programs without such a functionality.
As far as I've learned with your awesome MouseGestureL we can create 8-direction gestures, and it has the same core functionality as 8-items pie menus such these
2021-05-25193002.jpg
2021-05-25193002.jpg (24.74 KiB) Viewed 3495 times
I can work without any problems with 1-2 "8-direction gestures (=pie-menues)". However, if an application should have 5-10 of them,
2021-05-25195143.jpg
2021-05-25195143.jpg (23.45 KiB) Viewed 3495 times
it's hard to remember all the positions.
So, my question - is it possible to have a visual representation of 8-direction gestures similar to pie-menus?

comvox
Posts: 19
Joined: 29 Sep 2013, 22:48

Re: MouseGestureL

Post by comvox » 25 May 2021, 12:46

Hello @Antony,
you might check out whether the ahk program Radial Menu by "Learning one" would be of help for what you want.
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=12078&hilit=radial+menu .

Antony
Posts: 16
Joined: 04 Jun 2017, 05:10

Re: MouseGestureL

Post by Antony » 25 May 2021, 13:14

Hello @comvox ,
Oh, it looks very interesting. Thank you for the link! :)

maxsubs
Posts: 3
Joined: 25 May 2021, 09:18

Re: MouseGestureL

Post by maxsubs » 27 May 2021, 08:35

maxsubs wrote:
25 May 2021, 09:45
hey guys! I'm new with MouseGestureL.

I have a mouse with several buttons and I have assigned one of them to Launch_App2. I have called that button as "8" in MG and I want to use it as a media control gesture button:
Press > play/pause
Press+mouse up > volume up
Press+mouse down > volume down
Press+mouse left > previous song
Press+mouse right > next song

I also want the upper-left volume dialog to appear while changing volume. And for that this is my config:

Code: Select all

MG_Gesture_8_:
	if (!MG_IsExDefault()) {
		;Press Media_Play_Pause
		Send, {Media_Play_Pause}
	}
return

MG_GetAction_8_:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Media_Play_Pause"
	}
return

MG_Gesture_8_U:
	if (!MG_IsExDefault()) {
		;Press Volume_Up
		Send, {Volume_Up}
		;Sound Volume
		SoundSet, +5, MASTER, VOLUME
	}
return

MG_GetAction_8_U:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Volume_Up"
	}
return

MG_Gesture_8_D:
	if (!MG_IsExDefault()) {
		;Press Volume_Down
		Send, {Volume_Down}
		;Sound Volume
		SoundSet, -5, MASTER, VOLUME
	}
return

MG_GetAction_8_D:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Volume_Down"
	}
return

MG_Gesture_8_L_:
	if (!MG_IsExDefault()) {
		;Press Media_Prev
		Send, {Media_Prev}
	}
return

MG_GetAction_8_L_:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Media_Prev"
	}
return

MG_Gesture_8_R_:
	if (!MG_IsExDefault()) {
		;Press Media_Next
		Send, {Media_Next}
	}
return

MG_GetAction_8_R_:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Media_Next"
	}
return
But I have encountered two problems:
1 - While changing volume up/down the cursor starts to move and once it hits the upper/buttom edge volume can't no longer change. Is there a way, once I press "8" button and start moving the mouse up/down, to stop cursor from changing its position? so I can go volume up/down as much as I want.
2 - since the "8" button is assigned to play/stop every time I press to start some of the 4 gestures it also plays/pause. Is there a way to only play/pause if I don't do any gesture while pressing it?

Thanks a lot!
I'm still trying to solve this, can't find anywhere how to disable play/pause only on mouse gesture and how to stop cursor movement on gestures. I'd really like to master this script, it's so great, please someone help me out here. Thanks!

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

Re: MouseGestureL

Post by Pyonkichi » 28 May 2021, 04:43

@maxsubs,
1. Save cursor coordinates when the button is pressed, and restore them in the action script of up and down gestures. It's just an idea, I've not tried.
2. Use 8__ rather than 8_. (Saving of cursor coordinates of above idea has to be assigned to 8_)

maxsubs
Posts: 3
Joined: 25 May 2021, 09:18

Re: MouseGestureL

Post by maxsubs » 28 May 2021, 20:44

Pyonkichi wrote:
28 May 2021, 04:43
@maxsubs,
1. Save cursor coordinates when the button is pressed, and restore them in the action script of up and down gestures. It's just an idea, I've not tried.
2. Use 8__ rather than 8_. (Saving of cursor coordinates of above idea has to be assigned to 8_)
thanks so much for your help! Could you please guide me on how to save cordinates when the button is pressed and restore it after? I'm new to this. Where in the config do I write it

Code: Select all

MG_Gesture_8_U:
	if (!MG_IsExDefault()) {
		;Press Volume_Up
		Send, {Volume_Up}
		;Sound Volume
		SoundSet, +5, MASTER, VOLUME
	}
return

MG_GetAction_8_U:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Volume_Up"
	}
return

MG_Gesture_8_D:
	if (!MG_IsExDefault()) {
		;Press Volume_Down
		Send, {Volume_Down}
		;Sound Volume
		SoundSet, -5, MASTER, VOLUME
	}
return

MG_GetAction_8_D:
	if (!MG_IsExDefault()) {
		MG_ActionStr := "Press Volume_Down"
	}
return
Isn't there an option to simply freeze cursor movement when a mouse gesture is triggered? I'm not sure I'll be able to do it.
As for the second problem, I have tried mapping the mouse button as play/pause directly with the mouse software and on msl only mapped the gestures, for now when I just click it it play/pause and while on gesture it doesn't play/pause, but I have to wait and see if this is consistent on different ocassions.

User avatar
Patrick_Dayna
Posts: 44
Joined: 01 Jun 2021, 15:48

Re: MouseGestureL

Post by Patrick_Dayna » 01 Jun 2021, 16:34

I hope someone can help me solve this issue. I tried everything but no luck :cry:

How to get Rbutton to not do anything in Notepad but in every other software have it execute MGL action?
Right now, Rbutton Produces trails in Notepad, even though under notepad only Mbutton has actions assigned to it.

I really need to learn how to get MGL to "unhook "or "free up" a specific trigger when a specific software is active but still keep other triggers working in that software

Thank you!

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

Re: MouseGestureL

Post by Pyonkichi » 04 Jun 2021, 05:17

@Patrick_Dayna, Enable this option.
Attachments
mgl.jpg
mgl.jpg (9.69 KiB) Viewed 3243 times

User avatar
Patrick_Dayna
Posts: 44
Joined: 01 Jun 2021, 15:48

Re: MouseGestureL

Post by Patrick_Dayna » 05 Jun 2021, 17:36

Oh man excellent!
I am so happy, I will check this out as soon as I can
Thank you!

Post Reply

Return to “Scripts and Functions (v1)”