Responding to pressed keys

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

lebb
09-06-2003, 08:33 PM
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

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum