判断用户是否按下Ctrl、Alt、Shift

判断用户是否按下Ctrl、Alt、Shift

BOOL IsCtrlPressed()
{
 return ((GetKeyState(VK_CONTROL) & (1<<(sizeof(SHORT)*8-1))) != 0);
}

BOOL IsAltPressed()
{
 return ((GetKeyState(VK_MENU) & (1<<(sizeof(SHORT)*8-1))) != 0);
}

BOOL IsShiftPressed()
{
 return ((GetKeyState(VK_SHIFT) & (1<<(sizeof(SHORT)*8-1))) != 0);
}

你可能感兴趣的:(判断用户是否按下Ctrl、Alt、Shift)