'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
' initpage (adding colors, fonts, dimensions, ...)
InitPage
' adding controle for Tab keypress for all textboxes on page
ControleTab(txtZaposleniKoda)
ControleTab(txtDNKoda)
End Sub
' adding controle over keypress as reflector
Public Sub ControleTab(ctl As Object)
'allow Escape key to exit signin screen
Dim r As Reflector
r.Target = ctl
r.AddEventFilter("keypressed","javafx.scene.input.KeyEvent.KEY_PRESSED")
End Sub
' filter all keypress on textbox
Sub KeyPressed_Filter (e As Event)
Dim jo As JavaObject = e
Dim keycode As String = jo.RunMethod("getCode", Null)
If keycode = "TAB" Then
Log("tab")
Else
Log(keycode)
e.Consume
End If
End Sub