Click to See Complete Forum and Search --> : Detecting key pressed
Harry
Jun 20th, 1999, 08:15 PM
Does anyone know how to detect if the "Enter" key is pressed? Please, include some code please. Thanks!!
------------------
celsius
Jun 20th, 1999, 09:31 PM
try this:
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then MsgBox "You pressed enter!"
End Sub
Desire
Jun 21st, 1999, 02:33 AM
Try this
Private Sub TextBox1_KeyUp(KeyCode As Integer)
if keycode = vbreturn then
'DO THE THING
end if
End Sub
How can I track which keys are pressed whether they are in my application or not?
Harry
Jun 21st, 1999, 11:51 AM
Actually, I have a text box for the user to enter something and I want to execute a function when the user press "return" after he/she is finished entering something in the text box. How do you do that?
------------------
Stick
Sep 24th, 1999, 12:16 PM
make that key a HOT KEY IN Windows I Should Work Instead of haveing the hot key open the app make it Record the key
Aaron Young
Sep 24th, 1999, 01:34 PM
VirtuallyVB..
You can use the GetAsyncKeyState API, (I'm getting DejaVu I've Mentioned this API so much today...), eg.
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbKeyA) Then MsgBox "You Pressed 'A'"
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
Aaron I have a Logitech Internet Keyboard and I HATE IT. I can't assign any events to the keys on the side of the keyboard. Do you have any ideas on finding out how to get their states? I am trying to make a program that uses them for macros!
Please reply to my email address alfware@yahoo.com
I really looking forward to a reply
------------------
ALF
ALFWare
[This message has been edited by ALFWare (edited 12-29-1999).]
I have a Logitech Internet Keyboard and I HATE IT. I can't assign any events to the keys on the side of the keyboard. Do you have any ideas on finding out how to get their states? I am trying to make a program that uses them extra things
The keyboard has like 18 Extra keys on it and also a LED! It would be great if I could even find a API call that would cause a event on a key press so I could find the HEX address of that key!
Please reply to my email address alfware@yahoo.com
I really looking forward to a reply
p.s Did this to get it back up top! Sorry for any inconvience!
------------------
ALF
ALFWare
I really need help with this one so I am posting another message to take this one to hte top of the board sorries!
The keyboard has like 18 Extra keys on it and also a LED! It would be great if I could even find a API call that would cause a event on a key press so I could find the HEX address of that key!
Thanks again!
------------------
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.