|
-
Sep 24th, 2008, 01:15 PM
#4
Re: [2008] Show symbol for USB Num-Pad
It's a trickier problem than you may think since you're asking a program to intercept the keyboard. Windows only ever sees one keyboard. Even if you physically have 3 USB keyboards plugged into a computer, if you type "hello" on all three, you'd get three "hello"s on the screen, but as far as Windows is concerned, they all came from "THE Keyboard". It makes no distinction as to which one.
That said, it's entirely possible to do in VB.NET. The first thing you'd need to do is set up a low-level keyboard hook. This is done with some Windows API manipulation. Basically, this is the part that is intercepting the keypresses.
Next, you tie it into your program and have it check what keys are being pressed. When a certain key (like the NumLock) key is hit, you trigger an event that gives the notification you want.
First step is to establish the keyboard hook. Once you have got that working and maybe something simple like a messagebox is popping up, then you worry about giving it a fancy, unobtrusive notification. 
That's "how" you'd do it anyways. Any questions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|