input: ignore modifiers when releasing keys

This prevents keys from getting stuck if the modifier is released before
the base key.
This commit is contained in:
James Ross-Gowan 2014-02-20 22:44:20 +11:00
parent 08170c6a67
commit 1d0730d22d
1 changed files with 2 additions and 2 deletions

View File

@ -548,9 +548,9 @@ static void release_down_cmd(struct input_ctx *ictx, bool drop_current)
static int find_key_down(struct input_ctx *ictx, int code)
{
code &= ~(MP_KEY_STATE_UP | MP_KEY_STATE_DOWN);
code &= ~(MP_KEY_STATE_UP | MP_KEY_STATE_DOWN | MP_KEY_MODIFIER_MASK);
for (int j = 0; j < ictx->num_key_down; j++) {
if (ictx->key_down[j] == code)
if ((ictx->key_down[j] & ~MP_KEY_MODIFIER_MASK) == code)
return j;
}
return -1;