Solved

Check for Keyboard Key

Posted on 2006-06-27
1
671 Views
Last Modified: 2012-05-05
I am trying to write a vb.net application that watches for a specific key. When the key is pressed it performs a specific action. The problem is that i want to watch for this key while the program does not have focus and the program is in the system tray.

I found some code that kind of allows me to do this, but it is for blocking the OS from receiving these keys. In order to block them the code uses some pretty advanced API's and the entire computer hangs for a few seconds while the program is receiving those keys. I modified the code to perform an anction instead of blocking the keys, but the program still hangs often.

Is there an easier way to perfrom an action when a key is pressed if i don't want to block the OS from receiving the keys?
0
Comment
Question by:Paul S
1 Comment
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 50 total points
Comment Utility
Three basic methods:

(1) Register a Hotkey:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21549775.html

(2) Use a low level keyboard hook:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21584180.html

(3) Use a timer to poll the keyboard state:
I don't recommend this approach...
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now