From cce2b675acaef005720faed63106f7d98da7253e 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(-) diff --git a/input/input.c b/input/input.c index ee37ee03d6..def7b77710 100644 --- a/input/input.c +++ b/input/input.c @@ -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; -- cgit v1.2.3