Android Question menu key event

nikolaus

Member
Licensed User
Longtime User
Is there any way to track menukey_click directly? I'd like to create a popup-menu or start an activity immediately on keypress.

Activity.AddMenuItem needs an aditional click I want to avoid.

Thx Nikolaus
 

HotShoe

Well-Known Member
Licensed User
Longtime User
You can detect it in Activity_KeyPress. Something like:

B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
   
   If KeyCode =  KeyCodes.KEYCODE_MENU
 
   smain.OpenMenu

   Return True
   End If 
 
End Sub
 
Upvote 0
Top