Using GetKeyState()

后端 未结 5 1312
花落未央
花落未央 2020-12-10 15:46

I would like to have a boolean event toggle when a key is pressed. Specifically, the \'s\' key. I have been pointed to the function GetKeyState(), which supposedly works und

5条回答
  •  自闭症患者
    2020-12-10 16:15

    From what I understand you need to do:

    if( GetKeyState(115) & 0x8000 )
    {
        
    }
    

    The highest bit tells if key is pressed. The lowest tells if key is toggled (like, if caps lock is turned on).

提交回复
热议问题