diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2014-02-20 22:44:20 +1100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-03-11 00:14:22 +0100 |
commit | cce2b675acaef005720faed63106f7d98da7253e (patch) | |
tree | 6f9cea8ce8ca4506d9e9cf3134b38a4bf1cb152f /input | |
parent | c1ed4dc242f879b1080ad445df74fe60bc690584 (diff) | |
download | mpv-cce2b675acaef005720faed63106f7d98da7253e.tar.bz2 mpv-cce2b675acaef005720faed63106f7d98da7253e.tar.xz |
input: ignore modifiers when releasing keys
This prevents keys from getting stuck if the modifier is released before
the base key.
Diffstat (limited to 'input')
-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 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; |