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 do I make the computer a Key was Pressed

Status
Not open for further replies.

Wings

Programmer
Feb 14, 2002
247
US
Hi,
I need to amke the computer think that the Num Lock key was pressed inorder to return the Number Key pad to their original values eg: a 9 is a "9" key, not a "Pg Up" key.

I need to do this without actually pressing the key

Any help is appreciated

Thanks
 
you could physically change the state of num lock. that would do the same thing, instead of having to account for evenr key press, and discrimination between the actual num lock, insert, etc and the number ones.

try this:

if it's not what you want, let me know. Cyprus
[noevil]
 
or so:
keybd_event(VK_NUMLOCK,0,KEYEVENTF_EXTENDEDKEY | 0,0);
keybd_event(VK_NUMLOCK,0,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);
Both keybd_event turns off and turns on the Num Lock
 
Thanks for the help, I combined both approaches and it worked perfectly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top