Cancel XButton2 "unclick" Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
lboulluuu
Posts: 7
Joined: 26 Mar 2023, 09:57

Cancel XButton2 "unclick"

Post by lboulluuu » 26 Mar 2023, 10:05

I made a script such that "XButton2 & WheelUp" sends "Wheelup 4". However, when I use it and then let go of XButton2, it registers a button on XButton2 and (in my case) moves a page/folder forward.

Could you help me correct my script so as to "cancel" the "up" signal ?

I found this post on "XButton2 up" but it did not help : viewtopic.php?t=113147&p=504090

Here is my current script :

Code: Select all

~XButton2 & WheelUp::
{
	Send "{Wheelup 4}"
}
Thanks for your help

User avatar
mikeyww
Posts: 26940
Joined: 09 Sep 2014, 18:38

Re: Cancel XButton2 "unclick"  Topic is solved

Post by mikeyww » 26 Mar 2023, 10:45

Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v2.0
XButton1::XButton1
XButton1 & WheelUp::Send '{Wheelup 4}'
Explained: Tilde

lboulluuu
Posts: 7
Joined: 26 Mar 2023, 09:57

Re: Cancel XButton2 "unclick"

Post by lboulluuu » 03 Apr 2023, 11:52

I tried your script, it still lead to the XButton action to be performed, even without the Tilde.
Is there something I'm doing wrong ?

User avatar
mikeyww
Posts: 26940
Joined: 09 Sep 2014, 18:38

Re: Cancel XButton2 "unclick"

Post by mikeyww » 03 Apr 2023, 12:36

I was testing with XButton1, but you can change it to XButton2.

lboulluuu
Posts: 7
Joined: 26 Mar 2023, 09:57

Re: Cancel XButton2 "unclick"

Post by lboulluuu » 22 Apr 2023, 07:03

Thanks for your answer, it does not work with the script you suggested

This is my script, and this is my AHK windows :

Code: Select all

XButton2::XButton2
XButton2 & WheelUp::  ; Scroll up.
	Send {Wheelup 4}
return
image.png
image.png (19.45 KiB) Viewed 525 times
Thanks for your help

User avatar
mikeyww
Posts: 26940
Joined: 09 Sep 2014, 18:38

Re: Cancel XButton2 "unclick"

Post by mikeyww » 22 Apr 2023, 07:40

It worked here. It appears that you are running a script that differs from the script that you posted. A different script may yield different results. When you test a script from the forum, test it before you change it.

lboulluuu
Posts: 7
Joined: 26 Mar 2023, 09:57

Re: Cancel XButton2 "unclick"

Post by lboulluuu » 12 Dec 2023, 13:10

Hey, I still have the same problem

My script is still

Code: Select all

XButton2 & WheelUp::Send '{Wheelup 4}'
and I still get the click.
Is there a way I can prove it to you, with a screenshot or something else? Because "send,{Blind}{XButton2 Up}" appears for other hotkeys and don't cause the same problem

User avatar
mikeyww
Posts: 26940
Joined: 09 Sep 2014, 18:38

Re: Cancel XButton2 "unclick"

Post by mikeyww » 12 Dec 2023, 14:21

You have changed your script. Is that the entire script? Other scripts are closed? What is your new key history? Which line looks wrong or omitted there?

lboulluuu
Posts: 7
Joined: 26 Mar 2023, 09:57

Re: Cancel XButton2 "unclick"

Post by lboulluuu » 01 Jan 2024, 10:54

Sorry I should have worked with the MWE first.

When I use only this
~XButton2 & WheelUp::Send '{Wheelup 6}'
I get the unintended "next page" event.
This is the key history :
image.png
image.png (3.18 KiB) Viewed 291 times
When I remove the "~", that is
~XButton2 & WheelUp::Send '{Wheelup 6}'
I don't have the unintended "next page" event, but also when I just click XButton2 it doesn't go to next page anymore.
This is the key history :
image.png
image.png (2.65 KiB) Viewed 291 times
What details can I provide ? Thanks
Attachments
image.png
image.png (2.63 KiB) Viewed 291 times

User avatar
mikeyww
Posts: 26940
Joined: 09 Sep 2014, 18:38

Re: Cancel XButton2 "unclick"

Post by mikeyww » 01 Jan 2024, 14:18

In reviewing this thread, it appears that we achieved different results even with the same script. Thus, I do not have an answer. Others may have some better ideas here.

niCode
Posts: 295
Joined: 17 Oct 2022, 22:09

Re: Cancel XButton2 "unclick"

Post by niCode » 01 Jan 2024, 18:32

The first image you posted looks like it contains v1 syntax. This is the v2 forums. Which are you using?

lboulluuu
Posts: 7
Joined: 26 Mar 2023, 09:57

Re: Cancel XButton2 "unclick"

Post by lboulluuu » 07 Apr 2024, 04:22

I'm sorry that this thread has been lasting for so long, a year now.
My MWE is this, in AHK v2 :

Code: Select all

~XButton2 & WheelUp::Send '{Wheelup 6}'
If I remove the "~" for the script to be

Code: Select all

XButton2 & WheelUp::Send '{Wheelup 6}'
then clicking XButton2 doesn't go to next page anymore.

I deactivated my mouse software and still have the problem.

Can you reproduce that issue on your side? Can I provide more details to get some help?

Thanks a lot

User avatar
mikeyww
Posts: 26940
Joined: 09 Sep 2014, 18:38

Re: Cancel XButton2 "unclick"

Post by mikeyww » 07 Apr 2024, 07:02

See the documentation about custom combinations. The first script that I posted shows how to restore the button's native function when the button is released. We have now come full circle!

lboulluuu
Posts: 7
Joined: 26 Mar 2023, 09:57

Re: Cancel XButton2 "unclick"

Post by lboulluuu » 13 Apr 2024, 18:22

mikeyww wrote:
07 Apr 2024, 07:02
See the documentation about custom combinations. The first script that I posted shows how to restore the button's native function when the button is released. We have now come full circle!
Hi Mike, I think it worked ! :bravo:

Thanks a lot for your patience, I had completely missed the importance of the "XButton2::XButton2" bit, and had an other "~XButton2 &" that was messing with your solution.

The true MWE always wins in the end ^^'

Thanks again

Post Reply

Return to “Ask for Help (v2)”