From 1d0730d22d83e2334db136b0b9f943f02daecef4 Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Thu, 20 Feb 2014 22:44:20 +1100 Subject: input: ignore modifiers when releasing keys This prevents keys from getting stuck if the modifier is released before the base key. --- input/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'input') diff --git a/input/input.c b/input/input.c index 76cd571a04..96699b5ba0 100644 --- a/input/input.c +++ b/input/input.c @@ -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; -- cgit v1.2.3