Looks good, thanks Erel.
And btn_Action works well, also. But you're saying it's better to focus on the Click event, because the same code snippets will work in Android and IOS. So we'll keep _Action out of the project.
Btw, for anyone who is as dense as I am, and you often takes hours or days to get past very obvious oversights/syntax errors - DON'T FORGET to Add "_Event" to the end of the event name. In other words, if you use AddEventHandler to register "object_Click", then the name of the actual event has to be
Sub object_Click_Event( e As Event )
If you DON'T do this, you will be pulling your hair out, wondering why your elegant little event is being neglected (wah!) by the rest of the application.
One odd quirk is that the event seems to fire two times, for a single ENTER key pressed. At least it seems that way, according to the Log() output.
I can live with that, but if anyone has a suggestion to limit the event firing to one, that would help.
Sub AppStart (Form1 As Form, Args() As String)
'...
'...
'...
obj_Reflector.AddEventHandler( "btn_Click", "javafx.scene.input.KeyEvent.ANY" )
'...
'...
'...
End Sub
Sub btn_Click_Event( e As Event )
Dim KE As Reflector
KE.Target = e
Dim KeyCode As String
KeyCode = KE.RunMethod("getCode")
If KeyCode = "ENTER" Then
Log(KeyCode)
End If
End Sub