2010/09/29

C++ 키보드 상태 알아내기2




bool bLCtrl = (GetKeyState(VK_LCONTROL) & 0x8000) != 0;
bool bLShift = (GetKeyState(VK_LSHIFT) & 0x8000) != 0;
bool bLMenu = (GetKeyState(VK_LMENU) & 0x8000) != 0;

bool bCapsLock = GetKeyState( VK_CAPITAL ) != 0;
bool bNumLock = GetKeyState( VK_NUMLOCK ) != 0;
bool bScrollLock = GetKeyState( VK_SCROLL ) != 0;

TRACE("Caps Lock : %s, Num Lock : %s, Scroll Lock : %s \n"
, ( bCapsLock )? "ON": "OFF"
, ( bNumLock )? "ON": "OFF"
, ( bScrollLock )? "ON": "OFF"
);
<

Original Post : http://neodreamer-dev.tistory.com/461

No comments :

Post a Comment