MouseGestureL

Post your working scripts, libraries and tools for AHK v1.1 and older
Netmano
Posts: 58
Joined: 17 Jun 2020, 16:24

Re: MouseGestureL

28 Jun 2022, 17:56

The long awaited V1.40 has been released, WOOOOHOOOOOO!!
I am so happy to see this update, so thanks so much! :happybday: :happybday:
onaaa
Posts: 1
Joined: 03 Jul 2022, 06:34

Re: MouseGestureL

03 Jul 2022, 06:46

Code: Select all

MG_SendButton(name, btn, mode="")
{
	global
	SetMouseDelay,-1
	if (MG_%name%_Enabled) {
		GoSub, MG_%name%_Disable
		MG_%name%_Disabled := 1
	} else {
		MG_%name%_Disabled := 0
	}
	SendLevel 1
	Send, % "{Blind}{" . btn . (mode ? " "mode : "") . "}"
	if (MG_%name%_Disabled) {
		GoSub, MG_%name%_Enable
	}
}
Add sendlevel,this allows our other ahk scripts that use mouse buttons to work properly.

Incidentally,"Don't reproduce original mouse movements when undefined gesture is performed",this function occasionally does not work properly.I'm not sure why
waitwot
Posts: 1
Joined: 11 Aug 2022, 18:01
Contact:

Re: MouseGestureL

11 Aug 2022, 18:09

Hello, is it possible to have the gestures work on Windows 10's on screen keyboard (osk.exe)? I want to use a gesture to minimise it when done, but MGL is not able to start the recognition program on osk.exe

Additionally, is there a way to improve the recognition system for when using 8 direction mode? Sometimes the horizontal / vertical lines are recognised as diagonals, and vice versa. Maybe I need an explanation on how the detection threshold and the diagonal angle settings work.

Thank you for this amazing script, however! So far it has been working with my system and I am very appreciative of it.
Netmano
Posts: 58
Joined: 17 Jun 2020, 16:24

Re: MouseGestureL

11 Sep 2022, 15:33

@Pyonkichi
I have this issue I failed to solve for the past few days, I am wondering If Pyonkichi can give me help with it.

How can I release or temporarily "unhook" a MGL trigger that is currently being held down, using other Auothotkey scripts
In MGL, I have these gestures defined:

Code: Select all

MG_Gesture_RB__:
	if (!MG_IsExDefault()){
		Sendinput, ^{1}
		}
		return
		
MG_Gesture_RB_2_:  
	if (!MG_IsExDefault()){
		Sendinput, ^{2}
		}
		return
I have a seperate Auothotkey Script, Maya.Ahk that has this:

Code: Select all

space::
if GetKeyState("Rbutton", "p"){
	Sendinput, {x}
	}
else{
	Sendinput, {j}
	}
Return
The issue am having is that MGL inteferes with my Maya script. If I hold down space while Rbutton is down MGL gesture trails and hints are active and MGl actions also fire.

I have tried to send Rbutton back up first thing in my Maya script (so that MGL thinks Rbutton is released) this does not work:

Code: Select all

space::
if GetKeyState("Rbutton", "p"){
	Sendinput, {Rbutton Up}
	Sendinput, {x}
	}
else{
	Sendinput, {j}
	}
Return
I have also tried to suspend (and even pause) MGL script when I hold space down like this:

Code: Select all

space::
if GetKeyState("Rbutton", "p"){
	PostMessage, 0x111, 65305,,, MouseGestureL.ahk [list]AutoHotkey
	Sendinput, {x}
	PostMessage, 0x111, 65305,,, MouseGestureL.ahk [list]AutoHotkey
	}
else{
	Sendinput, {j}
	}
Return
This partly worked, MGL is suspended but when I release Rbutton still fires its actionscript one last time. Suspending while holding a MGL trigger also causes gesture trails to get stuck in drawing until I physically press that button again.


What am trying to accomplish is for a way for other Autohotkey scripts to cancell or "Unhook" a MGL trigger that is currently being held down. So that it would still be possible to use Rbutton in other Autohotkey scripts, for key combinations such as:
Rbutton and Space
Rbutton and A
Rbutton and X
etc.

NOTE: I know I can do this sort of thing in MGL. This is jut an example. I really need a way to make MGL and other Autohotkey scripts to work together. Thank you!
User avatar
Pyonkichi
Posts: 114
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

12 Sep 2022, 22:52

@Netmano,
I don't recommend such combination usage. The following sample seems to work, but it may cause unexpected problems. So it's just for reference.

MG_User.ahk:

Code: Select all

F15::
	if (MG_Active) {
		MG_Executed:=1
		MG_Aborted:=1
	}
return
External.ahk:

Code: Select all

Space::
	SendLevel, 1
	Send, {F15}
	Send, x
return
Netmano
Posts: 58
Joined: 17 Jun 2020, 16:24

Re: MouseGestureL

13 Sep 2022, 16:54

This is a fine example Pyonkichi! I will keep in mind what you said about unexpected problems.
I was not aware of this MG_user.ahk implementation of MGL at all, your example provides inspiration for few potential ideas. it seems like a briilliant idea for my ahk programs to access MGL objects.

I will take a few days and just to experiment. Thanks so much!
hellen_dorandt89
Posts: 25
Joined: 05 Jan 2022, 08:25

Re: MouseGestureL

31 Oct 2022, 15:43

Can I get some help with this please?

I would like to call a function every time I hold a MGL trigger.
For example, if RB and MB are my only two declared MGL triggers.
I would like to call a function if the triggers are ever held down.

The function should be called before I trigger a gesture such as RB_82_ or RB_7_, that is when I first held RB trigger. it should be the same for MB trigger and any other future triggers I may add.

Thank you!
NGuyEddie
Posts: 1
Joined: 07 Nov 2022, 01:34

Re: MouseGestureL

07 Nov 2022, 01:38

My right click in another script serves as a custom combination prefix. Is there a way to keep the functionality of Rbutton as a prefix combination on press (let’s say I press the suffix of the custom combination before drawing the gesture), but on press and draw gain the gesture functionality?
NBPEL
Posts: 2
Joined: 04 Dec 2022, 04:33

Re: MouseGestureL

18 Dec 2022, 14:27

Hi, I want to know if it's possible to show Default (Built-in) Gestures, for example Left = Back, Right = Forward in Web Browser but currently I can't see those default gestures and I want to see them to study and maybe disable them ?

https://i.imgur.com/ULhOh61.png
User avatar
Pyonkichi
Posts: 114
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

21 Dec 2022, 05:06

@NBPEL, No browser gestures are defined by default. RB_L_ and RB_R_ defined in the default target work for browsers.
Tiboru
Posts: 7
Joined: 12 Aug 2021, 09:38

Re: MouseGestureL

26 Jan 2023, 10:13

Trying to create a trigger for the '0' key (not Numlock block)

Trigger Button Definition:

Code: Select all

Description: 0
Button Name: k0
Key String: 0
Press Ok, nothing. The dialog does not close, no any messages are displayed. Also tried values: test / test / 0 with same result.

For the other triggers 1-9, everything works fine. Maybe this issue has already been discussed, is it a error or should it be? Maybe i'm doing something wrong?

Now to create a trigger '0' i've to do the following:

1. Create trigger 'Space', Trigger Button Definition:

Code: Select all

Description: Space
Button Name: kSpace
Key String: Space
2. '...MouseGesture\Config\UserButtons\' copy & rename 'kSpace.ahk' to 'k0.ahk'
3. Open 'k0.ahk' and replace all matches 'Space' to '0'
4. Reload MG

The trigger works, but in MG the ';Description = 0' field shows 'k0' instead of '0'.

PS AHK 1.1.36.02, MG 1.4
Tiboru
Posts: 7
Joined: 12 Aug 2021, 09:38

Re: MouseGestureL

26 Jan 2023, 11:55

I can also use virtual code / scan code, but it is still impossible to specify '0' in the 'Description' field
User avatar
Pyonkichi
Posts: 114
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

27 Jan 2023, 23:21

@Tiboru, Thanks for the reporting. It's a bug.
Modify MG_Edit.ahk as follows:

line 2227
before:

Code: Select all

	if (!desc || !name || !key) {
modified:

Code: Select all

	if (desc=="" || name=="" || key=="") {
line 2374
before:

Code: Select all

	if (!szDesc) {
modified:

Code: Select all

	if (szDesc=="") {
Tiboru
Posts: 7
Joined: 12 Aug 2021, 09:38

Re: MouseGestureL

28 Jan 2023, 03:36

@Pyonkichi Thanks for the fix.
gaberiel__2
Posts: 14
Joined: 18 Jan 2023, 14:18

Re: MouseGestureL

04 Feb 2023, 01:50

I am currently trying to move over to V2, MouseGesture L is core to my Autohotkey code base. So I am stuck with V1.

I am not much of a programmer, I find V1 to be a pain to use. I tested V2 and it solves many of my gripes with V1.

Can we please get a V2 port. It does not have to be any time soon. But I would appreciate to know that its on your road map.

Thanks for this library.
Tiboru
Posts: 7
Joined: 12 Aug 2021, 09:38

Re: MouseGestureL

18 Mar 2023, 02:38

Trying to create a hottkey (no matter what hk) that presses the '[' key, and AHK code for pressing the '[' key is not generated.

Code: Select all

Tab: Main
Field: Action script
Action: Generate key stroke
Button: Add
Field: Input key > '['
Button: Ok
Result: Empty 'Action script' field
PS MGL 1.4 with last fixes from post.
User avatar
Pyonkichi
Posts: 114
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

20 Mar 2023, 03:50

@Tiboru, Thanks. Modify MG_Edit.ahk to fix it.

line 6947
original:

Code: Select all

	szKey := RegExReplace(szKey, keyOrg, key)
modified:

Code: Select all

	szKey := RegExReplace(szKey, RegExMatch(keyOrg, "^[\\\[]") ? "\"keyOrg : keyOrg, key)
Tiboru
Posts: 7
Joined: 12 Aug 2021, 09:38

Re: MouseGestureL

20 Mar 2023, 10:08

@Pyonkichi, Thanks for the fix.
hellen_dorandt89
Posts: 25
Joined: 05 Jan 2022, 08:25

Re: MouseGestureL

08 Apr 2023, 05:58

@Pyonkichi
With AutoHotkey V2 being officially released now allot of developers are working on V2 versions of their libraries/programs.

Some well known libraries/programs that have recently released AutoHotkey V2 versions are:
ACC for AutoHotkey V2
AutoHotInterception V2
UIA V2

I just wanted to ask do you have any plans to release a AutoHotkey V2 version of MouseGestureL?
User avatar
Pyonkichi
Posts: 114
Joined: 16 May 2017, 20:40
Contact:

Re: MouseGestureL

09 Apr 2023, 06:06

@hellen_dorandt89,
I don't think there is a need to support v2 for now. Many people use the MGL as a standalone application. They don't care what programming language is used to implement the functionality.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: wilkster and 45 guests