Hotkey depending on duration of hold works for a key but does not for the button

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
A Keymaker
Posts: 455
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Hotkey depending on duration of hold works for a key but does not for the button

13 Oct 2023, 06:19

This test code works A-OK

Code: Select all

q::
   KeyWait, q, T0.999
   if (ErrorLevel)
   {   ; slow
      Send {a down}
      KeyWait, q
      Send {a Up}
   }
   else
   {   ; quick
      Send {b Down}
      Send {c Down}
      KeyWait, q
      Send {c Up}
      Send {b Up}
   }
Return
i.e. it sends bc when I press q key or a if I will hold down the q

But this version

Code: Select all

XButton1::
   KeyWait, XButton1, T0.999
   if (ErrorLevel)
   {   ; slow
      Send {a down}
      KeyWait, XButton1
      Send {a Up}
   }
   else
   {   ; quick
      Send {b Down}
      Send {c Down}
      KeyWait, XButton1
      Send {c Up}
      Send {b Up}
   }
Return
is only capable of sending bc when I quickly click Backward Mouse Button - i.e. ignoring a long pressing of that button by not sending the a but instead of it sending bc. But if I replace the XButton1 with e.g. RButton then I can send also the a with my mouse

This looks like another manifestation of this problem viewtopic.php?f=76&t=113037 with my Logitech Mouse MX device - only this time with Backward Mouse Button and not the Middle Mouse Button [as this test code from this post works when Right Mouse Button is used]. And so my question would be: how can I workaround this issue with my mouse [which device I will not replace as otherwise I am very pleased with how it works and I already bought more than one on the account of how much it fits my needs]?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: aseiot, Google [Bot], ntepa and 119 guests