Android Question How to disable/enable the mouse right click

kalarius

Active Member
Licensed User
Longtime User
I want to disable the right click of the mouse So if someone click the right mouse my program does not exit.

I have a button on the form that ends the program

Kalarakis
Creta
Greece
 

DonManfred

Expert
Licensed User
Longtime User
What does the rightclick do? Sending an back-key?
If yes, then check the given key and if it is the backkey....
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
hi,
I have the following code at the Activity_KeyPress (KeyCode As Int) As Boolean

If KeyCode = KeyCodes.KEYCODE_BACK Then

Msgbox("pressed back","")
Return True
End If

nothing happen when I press the right mouse button
it just exit from the program

***** at the program I am not use any keyboard
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
I have the device MK802III
this is something like a tablet
At the usb port i have connect a mouse
the left click of the mouse is the touch of the screen and the right click is the <- at the bottom of the tablet.
Pressing the <- the program exits
pressing the right mouse button , the program exit

I want the user to stay always into the main activity of my program and can not exit of it

Kalarakis
 
Upvote 0

imbault

Well-Known Member
Licensed User
Longtime User
Can you put a :
B4X:
Log(KeyCode )

If KeyCode = KeyCodes.KEYCODE_BACK Then
In order to catch in log the right click value
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
I have a break point at the sub activity_keypress

but never goes there
*** and I have the log(keycode)
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
** Activity (main) Create, isFirst = true **
** Activity (main) Pause, UserClosed = true ** *** that shows at log when I press thw Rright mouse button

the activity that load named "act1"
at the log shows that only the main activity is on
At the nonitor it shows me the act1
I have put the log(keycode) at the act1 sub
 
Upvote 0

kalarius

Active Member
Licensed User
Longtime User
hi,
the problem is that at the main activity I do not have the sub activity_keypress
and I write th code at wrong activity (act1)
I create at the main activity the sub keypress and now it works
keycode =4

thank
 
Upvote 0
Top