Log(Asc("a"))
Sub KeycodeFromString(s As String) As Object
Dim jo As JavaObject
Return jo.InitializeStatic("javafx.scene.input.KeyCode").RunMethod("getKeyCode", Array(s.ToUpperCase))
End Sub
It will return Null if there is no matching key.B4X:Sub KeycodeFromString(s As String) As String Dim jo As JavaObject Return jo.InitializeStatic("javafx.scene.input.KeyCode").RunMethod("getKeyCode", Array(s.ToUpperCase)) End Sub
The return type should be Object (I've updated my post).
I have a feeling that you are looking for the unicode code point.
B4X:Log(Asc("a"))