keypressed

pmu5757

Member
Licensed User
Hello
Here is my problem :
In my program, i want to launch subs when certain keys are pressed by user.
I made it in this little example and it works.


Sub App_Start
Form1.Show
End Sub


Sub Form1_KeyPress (specialKey)
Select specialKey
Case cDownKey
Msgbox("bas")
End Select
End Sub

My problem is that when I put theses lines in my "big" program, it doesn't work anymore.
When I press on the down key, I don't get the message box but I can see the focus jumping from one control to the other.
In my form, I have buttons and two webcam windows.
Maybe a focus problem ?
Thank you for your help.

Pascal.
 

pmu5757

Member
Licensed User
I tried your idea, but I've the same problem.
eplorateur is my form
ofrm is an object created with the door lib on my desktop

Here my new code.
Could you tell me what's wrong
Thank you

Sub App_Start
eplorateur.Show
ofrm.New1(False)
ofrm.FromControl("eplorateur")
ofrm.SetProperty("KeyPreview",True)
End Sub

Sub eplorateur_KeyPress (specialKey)
Select specialKey
Case cDownKey
Msgbox("bas")
End Select
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…