Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to detect data on few keys on a USB keyboard

Status
Not open for further replies.

mfm

Programmer
Jul 9, 2001
16
FR
hi guys, I am trying to detect these few keys from a USB keyboard. The keys are CUT, PASTE, COPY, HELP, and STOP. I have tried two aproaches in tackling this problem, which is detecting their ASCII code by using the keyboard hook method. The API function that I used including GetKeyboardState(), ToAscii() and GetKeyNameText(). Other normal standard keys are identified except these 5 keys. Then I tried another method by detecting their Virtual Key codes with the API function GetKeyState(). However these five keys still can't be detected. So I don't know what to do next.
But it seems like there is a table called USB HID Usage Table which shows that the codes for the keys are:-
CUT = H7B (Dec: 123)
PASTE = H7D (Dec: 125)
COPY = H7C (Dec: 124)
HELP = H75 (Dec: 117)
STOP = H78 (Dec: 120)
I am still not sure how to get those data yet. Any ideas? Thx a lot
 
Since you are not useing a standard keyboard I expect it comes with it's own software/driver. I would consult the manufacturer website to see if there is any way you can make use of the driver they provide.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top