So half of this question has been addressed before.
When you right-click on a mouse, it acts as the back button.
Previous topics have addressed that by blocking the back button.
I don't want to do that though. I only want to detect when the mouse is clicked and ONLY block right click from acting as the back button.
This is done in Android by checking GetSource() of the (event as KeyEvent) parameter in the keyup/down subs. But we don't have access to that parameter. How would I go about getting it?
But aren't you just trying to detect when there is a right click? If you only want to block it from acting as a back button then perform the action you want, then return true.
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
Select KeyCode
Case4
Do whatever
Return True
End Select
Return False
End Sub
I think it's cause I use a panel over top of the activity (so I can have a camera preview, and draw over top of it) the panel doesn't have the keyup event. Any ideas?
EDIT: got the event to fire by removing the return false from keypress
But
B4X:
Private input as JavaObject = Sender
Private btn as Int = input.RunMethod("getSource", Null)
isn't working. I get "method: getSource not found in activitywrapper"