diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2014-02-20 22:44:20 +1100 |
---|---|---|
committer | James Ross-Gowan <rossymiles@gmail.com> | 2014-02-20 23:07:53 +1100 |
commit | 1d0730d22d83e2334db136b0b9f943f02daecef4 (patch) | |
tree | 8be55331d35a2db91b4fe7af88352ad904983d71 | |
parent | 08170c6a67be2320ac86f03e76b318c784fb69f2 (diff) | |
download | mpv-1d0730d22d83e2334db136b0b9f943f02daecef4.tar.bz2 mpv-1d0730d22d83e2334db136b0b9f943f02daecef4.tar.xz |
input: ignore modifiers when releasing keys
This prevents keys from getting stuck if the modifier is released before
the base key.
-rw-r--r-- | input/input.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |