LR == true
(mind the double equal sign, otherwise you are writing an assignment instead of a comparison!) is unnecessary: just use LR
. Similarly, use !LR
instead of LR == false
. Also, adding a couple of parentheses won't hurt:
if (((keys & KEY_L) && LR) || ((keys & KEY_X) && !LR))
{
...
}