MouseGestureL

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

Re: MouseGestureL

Post by Pyonkichi » 27 Jul 2020, 10:03

@Avastgard, I don't find out root cause of the problem yet, but it is caused by the closing process of the hint display. So it can be solved by calling MG_StopNavi() before key sending.

Code: Select all

MG_StopNavi()
Send #d

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

Re: MouseGestureL

Post by Avastgard » 27 Jul 2020, 11:24

Pyonkichi wrote:
27 Jul 2020, 10:03
@Avastgard, I don't find out root cause of the problem yet, but it is caused by the closing process of the hint display. So it can be solved by calling MG_StopNavi() before key sending.

Code: Select all

MG_StopNavi()
Send #d
Tanks @Pyonkichi, I'll try that and will let you know if it works. Is that something I have to do with all commands or only this specific one?

While we're at it, there is something else I am having problems with. I configured RButton RL to send F5 to reload web page, windows folders, etc. However, it simply does not register. The funny thing is that this specific gesture was copied from another gesture I use and works quite well: RButton LR (it opens the MGL Configuration menu).

Here are some images of both:

Original gesture (works):
Image

Gesture based on the previous one (doesn't work):

Code: Select all

;Sends F5
Send, {F5}
Image

@Netmano I'm curious about this setup you put together for your sister. Would you care to share some of that with us?


EDIT: @Pyonkichi: I tried your suggestion, but the same probem persists.

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

Re: MouseGestureL

Post by Pyonkichi » 27 Jul 2020, 20:04

@Avastgard, Your configuration is correct, but usually end of the gesture pattern should be closed by underscore that means releasing a mouse button. See below.
Image
Many people stumble against this point. I'm considering to add the notification during initial setup.

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

Re: MouseGestureL

Post by Pyonkichi » 27 Jul 2020, 20:45

Avastgard wrote:
27 Jul 2020, 11:24
I tried your suggestion, but the same probem persists.
Hmm. I could reproduce the issue before taking the countermeasure, but it's solved with MG_StopNavi() in my environment.
Try changing the source code of MGL.

MouseGestureL.ahk - line: 2430,

Code: Select all

			Gui, MGW_ExNavi:Show, w1 h1 Hide
Fixed,

Code: Select all

			Gui, MGW_ExNavi:Show, Hide
Both have worked to solve the problem in my environment.

Netmano
Posts: 58
Joined: 17 Jun 2020, 16:24

Re: MouseGestureL

Post by Netmano » 28 Jul 2020, 11:54

@Pyonkichi

Can you help me with this please. I am using Shift and x keys as a trigger for my gestures.
Because I use Shift as part of my trigger. MGL also includes Shift modifer in action scripts it triggers.

For example
Shiftx_8_ :

Code: Select all

send, ^!{i}
Will execute Ctrl+Alt+Shift+i instead of just Ctrl+Alt+i

How do I get MGl to not include the modifier that was held down to trigger the gesture?

I have tried the below but its still not working
Shiftx_8_ :

Code: Select all

Send, {Blind}^!i
Shiftx_8_ :

Code: Select all

Sendinput, {Blind}^!i

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

Re: MouseGestureL

Post by Pyonkichi » 29 Jul 2020, 01:08

@Netmano,
I cannot reproduce the issue that you explain, means Ctrl+Alt+i is sent with exactly same settings. But I have an idea, if you still have the problem try to send shift key up.

Code: Select all

Send, {Shift up}^!i

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

Re: MouseGestureL

Post by Avastgard » 29 Jul 2020, 06:45

Pyonkichi wrote:
27 Jul 2020, 20:45
Avastgard wrote:
27 Jul 2020, 11:24
I tried your suggestion, but the same probem persists.
Hmm. I could reproduce the issue before taking the countermeasure, but it's solved with MG_StopNavi() in my environment.
Try changing the source code of MGL.

MouseGestureL.ahk - line: 2430,

Code: Select all

			Gui, MGW_ExNavi:Show, w1 h1 Hide
Fixed,

Code: Select all

			Gui, MGW_ExNavi:Show, Hide
Both have worked to solve the problem in my environment.
Yep, this solved my problem!

Also, adding the button up to the gestures seems to have fixed the problems I had. Thank you so much for such a wonderful script!

Netmano
Posts: 58
Joined: 17 Jun 2020, 16:24

Re: MouseGestureL

Post by Netmano » 29 Jul 2020, 11:30

@Pyonkichi
Pyonkichi wrote:
29 Jul 2020, 01:08

Code: Select all

Send, {Shift up}^!i
This is so simple. why did I not think like this...Thank you so much lol


One last question though.

I have been using F2 in place of Right click on my mouse hardware. It was a terrible idea. When MGL is running its perfect but when I am debugging other AHK scripts and need to quit all scripts, including MGL. I am left with a mouse that has no right click and many other situations I did not forsee Such as windows lock screen. Terrible :oops:

The reason why I was using F2 is so that I can combine it with modifiers.
Is there a way I can use Rbutton with modifiers? I am looking to create a trigger for Shift + Rbutton , another trigger for Shift + Mbutton but I really need a universal solution for entire MGL and not a solution like usung getkeystate in actionscript of a gesture because I am looking to use (!MG_Hold()) allot.

Something as close as to this proccess but for Shift + Rbutton and Shift + Mbutton Thanks!

Clipboard Image.jpg
Clipboard Image.jpg (28.7 KiB) Viewed 7878 times

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

Re: MouseGestureL

Post by Pyonkichi » 29 Jul 2020, 22:16

@Netmano,
You can define Shift+RB button manually by entering "+RButton" to the "Key String" field. But you will have same trouble as Previz's one, so you also need removing asterisks from RB.ahk and newly created ShiftRB.ahk.
Pyonkichi wrote:
25 Jul 2020, 22:13
Components\Buttons\F2.ahk
Current:

Code: Select all

MG_F2_Enable:
	Hotkey,*F2,MG_F2_DownHotkey,On
	Hotkey,*F2 up,MG_F2_UpHotkey,On
return

MG_F2_Disable:
	Hotkey,*F2,MG_F2_DownHotkey,Off
	Hotkey,*F2 up,MG_F2_UpHotkey,Off
return
To solve the problem, remove the asterisks:

Code: Select all

MG_F2_Enable:
	Hotkey,F2,MG_F2_DownHotkey,On
	Hotkey,F2 up,MG_F2_UpHotkey,On
return

MG_F2_Disable:
	Hotkey,F2,MG_F2_DownHotkey,Off
	Hotkey,F2 up,MG_F2_UpHotkey,Off
return
I will fix this issue in the next version.

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

Re: MouseGestureL

Post by Mika_erdo » 30 Jul 2020, 17:34

Hello everyone.
I create this account to ask question and to thank Pyonkichi, that work this software.

you make life easy for keyboard hand which get tired quickly when to reach for three button shortcut

Everyone here ask very good question, which help me allot to use the MGL. my favourite AHK software.
My english is okay but I try my best to explain.

I ask two question. it will help in understanding MGL and how to restore configuration in future.
So I ask
  • Is change ever written on MG_Edit.ahk? if user change setting through MG_edit GUI and click "OK"?
  • Is change ever written on MouseGestureL.ahk? if user change setting through MG_edit GUI and click "OK"?
Example, I delete MG_Edit.ahk and MouseGestureL.ahk and download new copy of the two deleted files from this thread here.
Place MG_Edit.ahk and MouseGestureL.ahk where the deleted one was. everything will be the same as before? no user setting lost?


I now define 150 gesture and create 3 trigger using MG_Edit.ahk GUI. If I want to move this user setting to new copy of MGL, I only need to copy and replace Components folder and Config folder? is this correct?

Thank you for any clarity.

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

Re: MouseGestureL

Post by Pyonkichi » 31 Jul 2020, 01:38

@Mika_erdo, You need to keep only the following files.

MouseGestureL
|
+-Config
| |
| +--MouseGestureL.ini
| |
| +--MG_User.ahk (If you have created the User Extension Script)
|
+--Components\Buttons\*.ahk (If you have created the user defined buttons)
|
+--Plugins\*.ahk (If you have added the plugins)

When you copy the above files to the new environment, select "Restart MouseGestureL" from the menu to reflect the configuration.

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

Re: MouseGestureL

Post by Mika_erdo » 31 Jul 2020, 07:28

@Pyonkichi

Thank you Pyonkichi!

So I spend some time this morning and follow your picture example and it work. it make things very simple now. specially when I experiment with MGL. very quick to retun back to two steps.

very usefull things I also discovered is with
MouseGestureL.ini you can some time chose not to use GUI screen and use notepad for example.

Netmano
Posts: 58
Joined: 17 Jun 2020, 16:24

Re: MouseGestureL

Post by Netmano » 31 Jul 2020, 13:42

@Pyonkichi
Sweet! thanks mate
Life is much simpler now when I have no AHK scripts running :D

User avatar
Previz
Posts: 28
Joined: 01 May 2020, 19:28

Re: MouseGestureL

Post by Previz » 02 Aug 2020, 09:34

@Pyonkichi
Can I get help with this please. Any ideas would really be appreciated.

I am trying to use F2 and Right button as a trigger.
I created F2 trigger. But I only want to ever use it with another button, such as Right button.

I have defined a gesture like so F2_RB_8_
it works fine but F2 on its own and mouse movement activate MGL trails
Is there a way to get MGL not to do anything when F2 on its own is pressed?

I have experimented with your solution below to user Netmano but it has limitations.
Because F2_RB_8_ and RB_8_ share same gesture, there cant be independent gesture hints.
Getkeystate also does not stop F2 from firing along with MGL actionscript.

I really need to have F2_RB_8_ as independent gesture. Seperate from RB_8_
Netmano wrote: I am trying to use two buttons to trigger a gesture, something like

Code: Select all

 F2_F7_8 :: send, ^a
so I created F2 and F7 as their own seperate trigger keys.

Then tried F2_F7_8 as a gesture

The problem is. F2 activates Trail strokes and arrows, it does not trigger what is assigned to F2 and F7 key combination
but is entirely occupied by MGL. How can I use F2 as a standard F2 key?
Pyonkichi wrote: @Netmano, Try the following.

Define F7_8_ as a gesture and assign the following actions:

Code: Select all

if (GetKeyState("F2", "P")) {
	; Put the action you need here.
	TrayTip,, Gesture was recognized
}

Netmano
Posts: 58
Joined: 17 Jun 2020, 16:24

Re: MouseGestureL

Post by Netmano » 02 Aug 2020, 17:43

Hey @Pyonkichi

I am trying to add >+Rbutton and >+Mbutton as a trigger but I am running into the same issue Previz has run into.I followed your solution to remove asteriks where needed but I am still getting issues of triggers being stuck down and trails not turning of.

I have created a simple example that demonstrates this. Its attached to my post. Please take a look.
Example.zip
(34.02 KiB) Downloaded 181 times
There are 3 folders inside;
MGL_Simple_Example
|
+-Buttons_with asteriks
|
+-Buttons_Without asteriks
|
|
+-Config


10 gestures are defined. RB_8_ and MB_8_ work just fine.

SHIFTMB_8_ and CTRLMB_8_ remain stuck when triggered. Its the same for RSHIFTMB_8_ and RSHIFTRB_8_ and others.

But as soon you delete gesture CTRLRB_8_ or another gesture, Everything goes back to working fine. RSHIFTMB_8_ fires the correct action script which is different from SHIFTMB_8_. Which is something I really need. Thanks!

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

Re: MouseGestureL

Post by Pyonkichi » 02 Aug 2020, 19:27

@Previz, If your problems are only hints and trails this can be the solution.

F2_:

Code: Select all

MG_StopNavi()
MG_StopTrail()
Send, {F2 Down}
F2_RB_:

Code: Select all

MG_StartNavi()
MG_StartTrail()
F2_RB_8_:

Code: Select all

TrayTip,, F2_RB_8_
RB_8_:

Code: Select all

TrayTip,, RB_8_
By the way, Getkeystate() does not work if the target key is used as a trigger (which is assigned to the hotkey).
That is the specification of the AHK.

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

Re: MouseGestureL

Post by Pyonkichi » 03 Aug 2020, 01:33

@Netmano,
Your configuration makes the same conflict as the setting with the asterisks even you removed them.
If you use +RButton and *RButton as the triggers (they are asiggned to the hotkeys), both hotkeys conflict to each other when the Shift+RButton is pressed. The trigger of +RButton conflict to >+RButton as well. You have to avoid those kind of conflict.
You can use <+RButton and >+RButton as the triggers in the same configuration, but +RButton cannot be used.

Netmano
Posts: 58
Joined: 17 Jun 2020, 16:24

Re: MouseGestureL

Post by Netmano » 03 Aug 2020, 15:26

@Pyonkichi

I see, that makes allot of sense. So my short coming was not deffrentiating between left and right modifiers. stupid :lol:

So I read your solution this morning, implemented your suggestions in the buttons folder but the issue did not go away.
after experimenting with various envoiroments of MGL I discovered the culprit was the file MG_Config.ahk in the Config folder.
I learnt, that whenever you make any change to the Buttons folder such as removing asteriks or even replacing the entire buttons folder you have to delete the MG_Config.ahk file for things to work.
Infact, after learning that, I tested you actually do not need to remove asteriks at all. just delete MG_Config.ahk and thats it.

Now everything is working correctly. LSHIFTMB and RSHIFTMB gestures do not confilict.

May I ask what is the MG_Config.ahk file for? you briefly mentioned something about "User Extension Script" can you explain abit more about it?

I just wanted to bring this to your attention anyways. You know your software inside out. So maybe you can make sense of what I am writting.


Thanks for your help once again!

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

Re: MouseGestureL

Post by Avastgard » 04 Aug 2020, 08:36

I've run into another problem. I tried to set a gesture to open a new tab in Chrome, but for some reason it's not working.

Image
Image

Do you see anything wrong with this setup?

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

Re: MouseGestureL

Post by Pyonkichi » 04 Aug 2020, 09:31

@Netmano,
MG_Config.ahk is the configuration script that is included by the main script.
MG_Edit.ahk converts the MouseGestureL.ini into MG_Config.ahk when OK button is pressed. And the conversion is also preformed when the "Restart MouseGestureL" is selected from the tray menu. So you have to do this operation when you have changed the configuration manually.
I recommend assigning the hotkey of the "Restart MouseGestureL". It is useful if you frequently change the configuration.

MG_User.ahk (User Extension Script) is also included by the main scripts.
You can put your own functions to call from the gesture actions. If you put the functions to determine the some conditions, you can use it in the target tab of the configuration dialog box by selecting "Custom Condition" and entering the function name.
MG_User.ahk can be used flexible, like putting some hotkeys instead of loading individual small scripts.
Last edited by Pyonkichi on 06 Aug 2020, 10:16, edited 4 times in total.

Post Reply

Return to “Scripts and Functions (v1)”