I need to trap keyboard event in the app on top level. (F8, F10 and so on)
It's for displaying a programming tools windows in my global application, even if there is not selected elements (textfields, etc..)
Is there a way to trap key_event like sub mainform_keypress_event or anything else ?
I use the GameViewHelper library with the following code to capture a press of the F1 key to display a help file.
B4X:
Private gvh As GameViewHelper
gvh.AddKeyListener("keylistener", MainForm)
Sub KeyListener_KeyPressed (KeyCode As String) As Boolean
If KeyCode.Length = 2 And KeyCode.StartsWith("F1") Then
Dim mf As ModalForm
mf.Initialize(MainForm)
mf.Show
End If
Return False
End Sub