Simultaneous mouse press/clicks - Trackball

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Simultaneous mouse press/clicks - Trackball

Post by Philharmonic » 24 Mar 2021, 23:15

Hi all,

I'm trying to figure out how to simultaneously press and click the top two buttons on my Kensington Trackball to initiate a plugin I use in my DAW. I have already remapped each individual buttons to do what I like, but pressing two at the same time does not work. I thought it was a simple script to press both buttons simultaneously, but obviously I was wrong :? Perhaps someone here can tell me what I did wrong. The script in question is below. Many thanks!

Code: Select all

MButton & XButton1::
WinMenuSelectItem, Pro Tools, , Audiosuite, Noise Reduction, RX 7 Mouth De-click
winwait, AudioSuite
wingetpos,,, w, h
controlclick, % "x" w-45 " y" h-25,,,,, NA
MouseMove, PrevX, PrevY
Sleep, 2500

if WinExist("ahk_class DigiFloaterClass")
	WinKill

Return 

User avatar
HiSoKa
Posts: 480
Joined: 27 Jan 2020, 15:43

Re: Simultaneous mouse press/clicks - Trackball

Post by HiSoKa » 25 Mar 2021, 01:16

try this:

Code: Select all

~MButton & XButton1::
WinMenuSelectItem, Pro Tools, , Audiosuite, Noise Reduction, RX 7 Mouth De-click
winwait, AudioSuite
wingetpos,,, w, h
controlclick, % "x" w-45 " y" h-25,,,,, NA
MouseMove, PrevX, PrevY
Sleep, 2500

if WinExist("ahk_class DigiFloaterClass")
	WinKill

Return
This code works with me without any problems:

Code: Select all

~Q & W::
MsgBox, u pressed q and w key in same time
Return

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Simultaneous mouse press/clicks - Trackball

Post by Philharmonic » 25 Mar 2021, 12:54

HiSoKa wrote:
25 Mar 2021, 01:16
try this:

Code: Select all

~MButton & XButton1::
WinMenuSelectItem, Pro Tools, , Audiosuite, Noise Reduction, RX 7 Mouth De-click
winwait, AudioSuite
wingetpos,,, w, h
controlclick, % "x" w-45 " y" h-25,,,,, NA
MouseMove, PrevX, PrevY
Sleep, 2500

if WinExist("ahk_class DigiFloaterClass")
	WinKill

Return
This code works with me without any problems:

Code: Select all

~Q & W::
MsgBox, u pressed q and w key in same time
Return
Thanks for your suggestion HiSoka, but unfortunately that does not work. I also tried that before as well. The second script you wrote works because that is a combination of two buttons from the keyboard and is straightforward.

It seems, for me at least, that it has to do with the actual trackball. It's not a typical mouse; therefore, the script might be more tricky per se. I do appreciate the help though :D

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Simultaneous mouse press/clicks - Trackball

Post by Philharmonic » 25 Mar 2021, 18:06

Suggestions :?: :eh:

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Simultaneous mouse press/clicks - Trackball

Post by Philharmonic » 29 Mar 2021, 23:54

No one??? :shock:

gregster
Posts: 9019
Joined: 30 Sep 2013, 06:48

Re: Simultaneous mouse press/clicks - Trackball

Post by gregster » 30 Mar 2021, 00:47

I don't have a trackball or the mentioned program.

But to help potential helpers, what does not work?
Does

Code: Select all

MButton & XButton1::
XButton1 & MButton::
	msgbox
return
do anything ? Please try also outside of that program.

Or does the hotkey trigger, but the Audiosuite just doesn't react (correctly) to the code inside the subroutine?
Can you successfully run that subroutine code, by instead using the hotkey w::, eg ?
Does your code work with a "normal" mouse (with a XButton1) in said program?

Did you try to run your script with elevated rights? See https://www.autohotkey.com/docs/FAQ.htm#uac

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Simultaneous mouse press/clicks - Trackball

Post by Philharmonic » 30 Mar 2021, 15:59

gregster wrote:
30 Mar 2021, 00:47
I don't have a trackball or the mentioned program.

But to help potential helpers, what does not work?
Does

Code: Select all

MButton & XButton1::
XButton1 & MButton::
	msgbox
return
do anything ? Please try also outside of that program.

Or does the hotkey trigger, but the Audiosuite just doesn't react (correctly) to the code inside the subroutine?
Can you successfully run that subroutine code, by instead using the hotkey w::, eg ?
Does your code work with a "normal" mouse (with a XButton1) in said program?

Did you try to run your script with elevated rights? See https://www.autohotkey.com/docs/FAQ.htm#uac
I tried various combinations and it does not work. I've also tried using it outside the program.

As mentioned earlier in my post, I'm able to individually reprogram each button on the Trackball to the task I want successfully. It's just for whatever reason pressing two buttons simultaneously does not work. I'm sure there's certain expressions or variables that I'm missing.

gregster
Posts: 9019
Joined: 30 Sep 2013, 06:48

Re: Simultaneous mouse press/clicks - Trackball

Post by gregster » 30 Mar 2021, 23:42

it does not work
Again, what is it ?

So the code with the msgbox doesn't work either? Then it seems to be a specific trackball issue.

But afaics you didn't really answer these questions - which might help to confirm or refute this suspicion:
gregster wrote:
30 Mar 2021, 00:47
Can you successfully run that subroutine code, by instead using the hotkey w::, eg ?
Does your code work with a "normal" mouse (with a XButton1) in said program?

Did you try to run your script with elevated rights? See https://www.autohotkey.com/docs/FAQ.htm#uac
Does your code work when you assign it to a single trackball button (like only XButton1, eg)?
What does the KeyHistory show for your Trackball "mouse" keys ?

Philharmonic
Posts: 50
Joined: 22 May 2017, 13:51

Re: Simultaneous mouse press/clicks - Trackball

Post by Philharmonic » 31 Mar 2021, 12:44

gregster wrote:
30 Mar 2021, 23:42
it does not work
Again, what is it ?

So the code with the msgbox doesn't work either? Then it seems to be a specific trackball issue.
The msgbox does not work, that's why I believe it has something to do with the trackball

But afaics you didn't really answer these questions - which might help to confirm or refute this suspicion:
gregster wrote:
30 Mar 2021, 00:47
Can you successfully run that subroutine code, by instead using the hotkey w::, eg ?
Does your code work with a "normal" mouse (with a XButton1) in said program?



Did you try to run your script with elevated rights? See https://www.autohotkey.com/docs/FAQ.htm#uac

Does your code work when you assign it to a single trackball button (like only XButton1, eg)?
What does the KeyHistory show for your Trackball "mouse" keys ?
Yes, I can run the subroutine code. The XButton1 does work on a "normal mouse" with a code that I use on a trackball.
Everything works as intended except for the combination. I works on a standard mouse as well as reprogramming individually on a trackball. Looking back at the documents, I think I might need to use GetKeyState into the equation.


Post Reply

Return to “Ask for Help (v1)”