Using IsContextualClick outside a mouse down event

System.MouseDown works everywhere, detecting a left click anywhere even outside the app itself. There is no equivalent for right clicking as IsContextualClick doesn’t seem to have the same system wide detection. Can I make it work this or another way? Thanks for the help!

Public Sub MouseDetect()
  If(listenToMouse) Then
    If(System.MouseDown And Not IsContextualClick) Then
      sysPrint("Left Click")
    ElseIf(IsContextualClick) Then
      sysPrint("Right Click")
    End
  End
End Sub
If System.MouseDown Then
  If Keyboard.AsyncControlKey Then
    MessageBox "Contextual click"
  End
End

This will work with an actual right click as well as the combo ctrl key? Most Windows and Linux users don’t ctrl+left click.

This unfortunately does not work with the true right click.

I’m using isContextualClick outside mousedown events, for instance in methods and listbox-change event like this:

Sub Change()
if me.ListIndex > 0 and IsContextualClick then
//do something
end if

Yeah, sorry, I was in my time machine when I wrote that, back in the days when mice only had one button.

1 Like

But will this detect globally like the System.MouseDown? Or just when right clicking the associated control?

Sorry, it does not work as system.nousedown.

It’s cool if it was an easy fix it’d be easily finable!