Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
Dim Obj As Reflector
Obj.Target = MainForm.RootPane
Obj.AddEventHandler2("RootPaneKeyEvent", "onKeyPressedProperty")
MainForm.Show
MainForm.RootPane.RequestFocus
End Sub
Sub RootPaneKeyEvent_Event(e As Event)
' bit hackish to get the code
Dim theKey As String = e
'Log(e)
Log("key pressed "& theKey.SubString2(theKey.IndexOf(", code = ")+9,theKey.Length-1))
End Sub
thanx to all, i just had to requestfocus to the rootpanel of mainform
gameview would be the right choice since i want to make a game but because it is for the game competition where no game libs are allowed i will use jreflection