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-03-11 00:14:22 +01:00
committed by wm4
parent c1ed4dc242
commit cce2b675ac
+2 -2
View File
@@ -544,9 +544,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;