Detecting any key being pressed.

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2006
Posts: 17
Reputation: mstester is an unknown quantity at this point 
Solved Threads: 0
mstester mstester is offline Offline
Newbie Poster

Detecting any key being pressed.

 
0
  #1
Mar 29th, 2007
Hey all,

Is there a way that I can detect when any key has been pressed?

Basically I have a login box and if the user has Caps Lock on and tries to enter his password a Tooltip apears, however as soon as they type again I want the tool tip to disappear. Is there away i can detect the user has hit a key??

Thanks
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Detecting any key being pressed.

 
0
  #2
Mar 29th, 2007
Yes, I think so. Although because caps lock is considered an oddity you might only be able to access it from a lower level api call. So it is a lot more work.

http://www.a1vbcode.com/snippet-3541.asp

Perhaps and:-

http://blogs.msdn.com/michkap/archiv...29/562606.aspx
Last edited by iamthwee; Mar 29th, 2007 at 3:12 pm.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 812
Reputation: arjunsasidharan is on a distinguished road 
Solved Threads: 13
arjunsasidharan's Avatar
arjunsasidharan arjunsasidharan is offline Offline
Practically a Posting Shark

Re: Detecting any key being pressed.

 
0
  #3
Mar 30th, 2007
yes you can do it in the forms keypress event. Are you working with windows application or console applications. if its windows then u can fine Forms-> KeyPress Event or search it in msdn library
There is just two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 50
Reputation: KillerOfDN has a little shameless behaviour in the past 
Solved Threads: 1
KillerOfDN KillerOfDN is offline Offline
Junior Poster in Training

Re: Detecting any key being pressed.

 
0
  #4
Jun 14th, 2008
If your using .NET 3.5 you won't have to worry about the Caps lock being on as a warning is shown automatically for you! (I think this will only work if you have set the UseSystemPasswordChar attribute to True, this will only take effect after your project has been published i.e: not in design/run time).
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC