B4X:
'
Dim TextField1 as TextField
Dim TextField2 as TextField
Dim TableView1 As TableView
'
ref (TextField1)
ref (TextField2)
ref (TableView1)
'
'
'
'
Private Sub ref (t As Object)
Dim r As Reflector
r.Target = t
r.AddEventHandler("keypressed", "javafx.scene.input.KeyEvent.KEY_PRESSED")
End Sub
'
Private Sub keypressed_event (e As Event)
Log("How to know the object? ")
Dim tt As Object = Sender
Log(GetType(tt)) 'is that correct?
'
Dim KE As Reflector
KE.Target = e
Dim KeyCode As String
KeyCode = KE.RunMethod("getCode")
Log(KeyCode)
End Sub