I can't get keycode.
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
AddKeyPressedListener
End Sub
Sub AddKeyPressedListener
Dim r As Reflector
r.Target = MainForm.RootPane
r.AddEventHandler("keypressed", "javafx.scene.input.KeyEvent.KEY_PRESSED")
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub KeyPressed_Event (e As Event)
Log("d")
Dim jo As JavaObject = e
Dim keycode As String = jo.RunMethod("getCode", Null)
If keycode = "ESCAPE" Or keycode = "C" Then
ExitApplication
Else If keycode = "A" Then
Else If keycode = "N" Then
End If
End Sub