Home > Software engineering >  How to determine whether small keyboard digital NUM lock key switch?
How to determine whether small keyboard digital NUM lock key switch?

Time:10-08

How to determine whether small keyboard digital NUM lock key switch?

thank you

CodePudding user response:

Add # include & lt; Windows. H>
Then use: BOOL b=GetKeyState (VK_NUMLOCK); To judge, if b is 1 is opened, zero is not opened

CodePudding user response:

GetKeyboardState
 
BYTE keyState [256]={0};
If (GetKeyboardState (keyState))
{
BYTE bNumLock=keyState [VK_NUMLOCK];
TRACE (_T (" VK_NUMLOCK 02 x=% \ n "), bNumLock);
}

  • Related