I guess you need to walk before you run. I am trying to intercept the D-Pad key presses so I can hop around controls in a form. I have tried using ControlName_KeyPress (SpecialKey) but when I compile and run it on the PPC, nothing happens. I suspect this need is common but I can't find an example on the forum (not looking hard enough?). Can this be used for DPad navigation? Thanks, Dave
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
Form1.Show
form1.Focus
End Sub
Sub ControlName_KeyPress (SpecialKey)
Msgbox (SpecialKey)
End Sub
The form never gets the focus if there are any other controls on it that can be focused.
One solution is to change the form's KeyPreview property using the Door library: http://www.b4x.com/forum/showthread.php?t=2038 (first example).
After adding this code you can use Form1_KeyPress event to handle the D-Pad buttons.
Thanks so much for the response. I still must not be getting it, the following code does not display any msgbox when the D-Pad keys are pressed.
Thanks, dave
' Uses door.dll, ofrm is an object
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
Form1.Show
ofrm.New1(false)
ofrm.FromControl("Form1")
ofrm.SetProperty("KeyPreview",true)
End Sub
Sub ControlName_KeyPress (SpecialKey)
Msgbox (SpecialKey)
End Sub