Jatopian
09-06-2003, 05:59 PM
Hello again,
I have two questions.
What is the code for making a program do something when a specific key is pressed?
What is the code for making a program do something when a specific sequence of keys are pressed?
Does anyone know the answers to these?
-Jatopian
reboot
09-06-2003, 06:02 PM
Oddly enough, you respond to keypresses in the KeyPress event.
Jatopian
09-06-2003, 06:28 PM
Oddly enough, you respond to keypresses in the KeyPress event.
Whoa, no way... :chuckle:
How do I use this event? (How do I code it?)
-Jatopian
Look up KeyPress in MSDN. Complete with examples. :)
emidio
09-06-2003, 09:07 PM
'first turn the FORM KEYPREVIEW option to TRUE, then,
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = ??? And Shift = ??? Then
' writte your code here ou call a sub...
End If
End Sub
Jatopian
09-07-2003, 03:39 PM
Look up KeyPress in MSDN. Complete with examples. :)
I took your advice before you gave it! Maybe ESP is real after all... :p
What I actually needed, though, was the KeyDown event. (KeyPress leaves out the arrow keys.)
Thanks for the advice! :D
-Jatopian