Pages: [1]
  Print  
Author Topic: C++ code for numlock  (Read 3116 times)
Offline (Unknown gender) death-droid
Posted on: August 10, 2008, 12:56:00 AM
Member
Joined: Aug 2008
Posts: 19

View Profile
cpp{
int  ReqdNumLockState = 0x0008;


if( (GetKeyState( VK_NUMLOCK ) & 0x0008) != ReqdNumLockState )
{
  //Ponemos el NumLock a ON, para que se pueda escribir con el numpad directamente.
  keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 );
  keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY |   KEYEVENTF_KEYUP, 0 );
 }
}


There you go all just in case you needed it XD
Logged
Offline (Male) RetroX
Reply #1 Posted on: August 10, 2008, 02:09:08 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
What exactly does it do...?  Me no speak spanish.  Translate comments, please.  I'm pretty sure it turns on/off the numlock, but I can't be sure.  Please do not thrust code into our hands and expect us to know what it does.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) indecom
Reply #2 Posted on: August 10, 2008, 02:56:46 PM
Member
Joined: Aug 2008
Posts: 4

View Profile Email
It toggles numlock on and off.
Logged
Offline (Unknown gender) death-droid
Reply #3 Posted on: August 11, 2008, 01:05:28 AM
Member
Joined: Aug 2008
Posts: 19

View Profile
Lol woops for got to put the translated version up and yes it does toggle the numlock but it was also one of the requested things
Logged
Pages: [1]
  Print