Hi,
What is the best way to detect if a mouse click was a right click?
The following code detects left or right as the same click
I suppose I could add a global variable in Main (public lastMouseEvent as MouseEvent) and check that in my mBase_touch(....) sub. [Edit] Just tried that and it does not work.
But is there a better way?
What is the best way to detect if a mouse click was a right click?
The following code detects left or right as the same click
B4X:
Private Sub mBase_Touch (Action As Int, X As Float, Y As Float)
' HANDLE CLICK AND LONGCLICK
'Log("Action = " & Action)
Select Action
Case mBase.TOUCH_ACTION_DOWN
Log("Action = " & Action)
mTimeDown = DateTime.Now
tmrClick.Enabled = True
Case mBase.TOUCH_ACTION_UP
If DateTime.Now - mTimeDown <= mClickTime Then
If xui.SubExists(mCallBack, mEventName & "_Click", 0) Then
CallSubDelayed(mCallBack, mEventName & "_Click")
tmrClick.Enabled = False
End If
End If
End Select
I suppose I could add a global variable in Main (public lastMouseEvent as MouseEvent) and check that in my mBase_touch(....) sub. [Edit] Just tried that and it does not work.
But is there a better way?
Last edited: