Only when nFlag is 00000001, it will be true.

You have to understand what is the outcome for a bit AND. For example, 01010101 & 00000001 = 00000001 and 01010101 & 00001111 = 00000101.

If what you want is the opposite, the code should be:

if ((nFlags & MK_LBUTTON) != 0)

You have to understand what is the outcome for a bit AND. For example, 01010101 & 00000001 = 00000001 and 01010101 & 00001111 = 00000101.

If what you want is the opposite, the code should be:

if ((nFlags & MK_LBUTTON) != 0)