MouseGestureL

Post your working scripts, libraries and tools for AHK v1.1 and older
kocelac205
Posts: 24
Joined: 04 Jul 2021, 01:15

Re: MouseGestureL

04 Jul 2021, 09:18

is it possible to assign a long press of a button to various tasks?? came across a neat little script in the forum called Increased functionality of buttons which lets u assign different actions depending on a long press and a very long press..of course a normal press wud jus pass through as a normal click
kocelac205
Posts: 24
Joined: 04 Jul 2021, 01:15

Re: MouseGestureL

11 Jul 2021, 07:11

Pyonkichi wrote:
06 Nov 2020, 19:16
@Sleatness,
If you use Chrome, assign the action "Send, ^{LButton}" to the gesture for background and "Send, ^+{LButton}" for foreground.
can this be edited in any way to search selected text in google in a background and foreground tab
also wud it be possible to distinguish between text and hyperlink and act separately based on wht it is
Mika_erdo
Posts: 41
Joined: 30 Jul 2020, 17:23

Re: MouseGestureL

21 Jul 2021, 17:49

kocelac205 wrote:
04 Jul 2021, 09:18
is it possible to assign a long press of a button to various tasks?? came across a neat little script in the forum called Increased functionality of buttons which lets u assign different actions depending on a long press and a very long press..of course a normal press wud jus pass through as a normal click
By long press do you mean hold down a key or a gesture direction? if so something like this works.

Code: Select all

;Execute After Button Up
if (!MG_Hold()) {
	;Action to be performed immediately after the gesture has been entered.
	Tooltip, Key is Down
} else {
	;Action to be performed when a button has been released.
	Tooltip, Key is UP
}
;This processing can be added from "Execute After Button Up" in the action template list.
You need to make sure your gesture has the correct configuration though. For example RB__ Would need to be RB_ for it to work.
kocelac205
Posts: 24
Joined: 04 Jul 2021, 01:15

Re: MouseGestureL

23 Jul 2021, 22:28

Mika_erdo wrote:
21 Jul 2021, 17:49
kocelac205 wrote:
04 Jul 2021, 09:18
is it possible to assign a long press of a button to various tasks?? came across a neat little script in the forum called Increased functionality of buttons which lets u assign different actions depending on a long press and a very long press..of course a normal press wud jus pass through as a normal click
By long press do you mean hold down a key or a gesture direction? if so something like this works.

Code: Select all

;Execute After Button Up
if (!MG_Hold()) {
	;Action to be performed immediately after the gesture has been entered.
	Tooltip, Key is Down
} else {
	;Action to be performed when a button has been released.
	Tooltip, Key is UP
}
;This processing can be added from "Execute After Button Up" in the action template list.
You need to make sure your gesture has the correct configuration though. For example RB__ Would need to be RB_ for it to work.
this is very cool but slightly different frm wht i need..this only distinguishes btw a click..i was looking more for a long press action rather than jus button up and button down..for example holding down the right mouse button for some time wud trigger an action...or holding down at the end of gesture like say if it is RB_U_ immediately releasing it wud trigger one action else if held down for some time and thn realeased wud trigger another action..i hope i was not confusing..will tht be possible ??
User avatar
submeg
Posts: 326
Joined: 14 Apr 2017, 20:39
Contact:

Re: MouseGestureL

24 Jul 2021, 01:38

Antony wrote:
25 May 2021, 13:14
Hello @comvox ,
Oh, it looks very interesting. Thank you for the link! :)
Hey @Antony, I second the use of Radial Menu! I use both Radial Menu and MouseGestureL together; I just changed the trigger key for the Radial Menu to Right Alt instead of the RButton, so I could still use MouseGestureL. Let me know if you'd like any help with the Radial Menu.
____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
User avatar
submeg
Posts: 326
Joined: 14 Apr 2017, 20:39
Contact:

Re: MouseGestureL

24 Jul 2021, 01:46

kocelac205 wrote:
23 Jul 2021, 22:28
this is very cool but slightly different frm wht i need..this only distinguishes btw a click..i was looking more for a long press action rather than jus button up and button down..for example holding down the right mouse button for some time wud trigger an action...or holding down at the end of gesture like say if it is RB_U_ immediately releasing it wud trigger one action else if held down for some time and thn realeased wud trigger another action..i hope i was not confusing..will tht be possible ??
Hey @kocelac205,

I am able to layer three different actions ono a hotkey combination using the script below. Note: If you want to use just a single button, remove "Button1".

Code: Select all


Button1 & Button2::

KeyWait, Button2, T0.2

if (ErrorLevel) {		;received a long press -

	DOSOMETHING()

}

else {

	KeyWait, Button2, D T0.1
	If (ErrorLEvel) {	;received a short press -

		DOSOMETHING()

	}

	else {			;received a double press -

		DOSOMETHING()

	}

}

KeyWait, Button2

Return

____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
Mika_erdo
Posts: 41
Joined: 30 Jul 2020, 17:23

Re: MouseGestureL

25 Jul 2021, 07:44

kocelac205 wrote:
23 Jul 2021, 22:28
this is very cool but slightly different frm wht i need..this only distinguishes btw a click..i was looking more for a long press action rather than jus button up and button down..for example holding down the right mouse button for some time wud trigger an action...or holding down at the end of gesture like say if it is RB_U_ immediately releasing it wud trigger one action else if held down for some time and thn realeased wud trigger another action..i hope i was not confusing..will tht be possible ??
Pardon me I missed your message yesterday.

I dont think there is a MGL function for this but you can achieve it with standard AHK code that can be triggered through MGL. You could even pass the function that you linked to in your first post to MGL.

Seems like a cool idea. I will take a look myself, If I do implement it in MGL, I will run it by you.
User avatar
submeg
Posts: 326
Joined: 14 Apr 2017, 20:39
Contact:

Re: MouseGestureL

28 Jul 2021, 06:59

Hey all, I notice in line 12 of MG_Edit.ahk, I notice that the tray icon is updated:

Menu, Tray, Icon, %MG_IconFile%, 2

How do you create an icon that actually contains two icons?
____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
jwwpua
Posts: 13
Joined: 06 Aug 2021, 15:03

Re: MouseGestureL

06 Aug 2021, 15:12

@Pyonkichi Is it possible to hide the RB_← (or even just the RB_) in the "advanced hint"? I like everything else about "advanced" hints, but the RB_ is not necessary for me because all of my gestures use RB_. Thank you!
image.png
(17.73 KiB) Downloaded 87 times
User avatar
Pyonkichi
Posts: 107
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

09 Aug 2021, 10:07

@submeg, dll or icl (icon library) can contain multiple icon resources. You can create icl by this software.
http://greenfishsoftware.org/gfie.php#apage

@jwwpua, no such option.
jwwpua
Posts: 13
Joined: 06 Aug 2021, 15:03

Re: MouseGestureL

11 Aug 2021, 15:46

@Pyonkichi Do you know why this isn't clicking in the correct place? It clicks where my mouse is at the END of the gesture, rather than where my mouse was at the START of the gesture. Aside from clicking in the wrong place, it works properly. Thank you!

[RB_]

Code: Select all

;Activate Window
if (!WinActive() && MG_WClass!="Chrome_WidgetWin_2") {
	WinActivate
	CoordMode,Mouse,Screen
	MouseGetPos, mXpos, mYpos
}

[RB_LR_LB___]

Code: Select all

;Select line
CoordMode,Mouse,Screen
MouseClick, left, mXpos, mYpos
Send, {Home}+{End}

EDIT: Got it working! Had to capture the MouseGetPos outside of my IF statement for RB_.

Code: Select all

;Activate Window
CoordMode, Mouse, screen
MouseGetPos, mXpos, mYpos
if (!WinActive() && MG_WClass!="Chrome_WidgetWin_2") {
	WinActivate
}
User avatar
Pyonkichi
Posts: 107
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

11 Aug 2021, 20:08

@jwwpua,
You can use MG_X and MG_Y that are gesture start coordinates.
Other built-in variables and functions are listed on the following help page.

Advanced usage > Advanced Supplementary Information > Utility variables and functions
Last edited by Pyonkichi on 20 Aug 2021, 19:19, edited 2 times in total.
jwwpua
Posts: 13
Joined: 06 Aug 2021, 15:03

Re: MouseGestureL

12 Aug 2021, 20:59

@Pyonkichi Nice, that's even easier! Thank you. I'm really enjoying MGL.
Avastgard
Posts: 133
Joined: 30 Sep 2016, 21:54

Re: MouseGestureL

20 Aug 2021, 15:17

I have a Logitech MX Master 3 mouse with a horizontal scroll wheel and I'm trying to create gestures using this horizontal wheel as a gesture trigger. Should I use the Wheel Tilting Right and Wheel Tilting Left triggers to achieve that or is that only for actual wheel tilting (i.e. not scrolling)?
User avatar
submeg
Posts: 326
Joined: 14 Apr 2017, 20:39
Contact:

Re: MouseGestureL

05 Sep 2021, 02:55

Avastgard wrote:
20 Aug 2021, 15:17
I have a Logitech MX Master 3 mouse with a horizontal scroll wheel and I'm trying to create gestures using this horizontal wheel as a gesture trigger. Should I use the Wheel Tilting Right and Wheel Tilting Left triggers to achieve that or is that only for actual wheel tilting (i.e. not scrolling)?
Hey @Avastgard , if you use KeyHistory, what does it show you?
____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
Avastgard
Posts: 133
Joined: 30 Sep 2016, 21:54

Re: MouseGestureL

14 Sep 2021, 17:38

It shows WheelRight and WheelLeft
agustav3
Posts: 6
Joined: 21 Sep 2021, 07:11

Double mouse button gesture

21 Sep 2021, 07:17

Hi,

I'm wondering if anybody could help me how to create a double mouse button gesture in this awesome app. I.e. in order to activate a gesture both mouse buttons should be pressed.

Thanks in advance and have a great day.

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

Re: Double mouse button gesture

22 Sep 2021, 15:13

agustav3 wrote:
21 Sep 2021, 07:17
Hi,

I'm wondering if anybody could help me how to create a double mouse button gesture in this awesome app. I.e. in order to activate a gesture both mouse buttons should be pressed.

Thanks in advance and have a great day.

Br,
Andreas
Just select the buttons you want to use as triggers and then add the cursor movement as desired.

In the picture below, I selected both mouse buttons as triggers to minimize a window. I didn't include a gesture on this specific command, but you could easily do so by clicking on the arrows under Cursor Movement.
image.png
image.png (54.82 KiB) Viewed 4060 times
Image
agustav3
Posts: 6
Joined: 21 Sep 2021, 07:11

Re: Double mouse button gesture

24 Sep 2021, 02:08

Thanks for the reply. I've played around in gui but I can't seem to figure out how to achieve a double mouse button click followed by a gesture (and then of course letting go of the mouse buttons to end the gesture)

The example you gave below works for me and the active window is minimized. However I never managed to create a minimize action triggered by for example pressing both mouse buttons and drawing a down gesture. I would be very happy if you could try creating such command and post how to do it :)

Thanks in advance!

Br,
Andreas
Avastgard wrote:
22 Sep 2021, 15:13
agustav3 wrote:
21 Sep 2021, 07:17
Hi,

I'm wondering if anybody could help me how to create a double mouse button gesture in this awesome app. I.e. in order to activate a gesture both mouse buttons should be pressed.

Thanks in advance and have a great day.

Br,
Andreas
Just select the buttons you want to use as triggers and then add the cursor movement as desired.

In the picture below, I selected both mouse buttons as triggers to minimize a window. I didn't include a gesture on this specific command, but you could easily do so by clicking on the arrows under Cursor Movement.

image.pngImage
Avastgard
Posts: 133
Joined: 30 Sep 2016, 21:54

Re: MouseGestureL

29 Sep 2021, 09:38

Here you go:

image.png
image.png (59.61 KiB) Viewed 3933 times

This particular gesture opens notepad

image.png
image.png (42.27 KiB) Viewed 3933 times

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

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 106 guests