Does anyone know how to detect if the "Enter" key is pressed? Please, include some code please. Thanks!!
------------------
Printable View
Does anyone know how to detect if the "Enter" key is pressed? Please, include some code please. Thanks!!
------------------
try this:
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then MsgBox "You pressed enter!"
End Sub
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?
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?
------------------
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
VirtuallyVB..
You can use the GetAsyncKeyState API, (I'm getting DejaVu I've Mentioned this API so much today...), eg.
------------------Code: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
[email protected]
[email protected]
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 [email protected]
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 [email protected]
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!
------------------