i understand what the above function does , in its definition its written
"If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState."
i am confused what this means - "If the most significant bit is set".
i have idea what MSB and LSB are. but what does 'set' exactly means here.
and - & 1 -> dnt understand the use of &operator here. i have only used & for references till now.
any help will be appreciated
Set means it's a 1 vs a 0. The & in this scenario is the bit and operator.
The lsb would be what signifies if a number is even or odd. & with 1 if the lsb is 1 the result would be 1 or true otherwise false. At least I believe that to be the case.