Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Check for Keyboard Key

Posted on 2006-06-27
1
Medium Priority
?
682 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 200 total points
ID: 16998362
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
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 …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

604 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