Skip to content

Instantly share code, notes, and snippets.

@rossy
Created February 20, 2014 10:51
Show Gist options
  • Select an option

  • Save rossy/9111088 to your computer and use it in GitHub Desktop.

Select an option

Save rossy/9111088 to your computer and use it in GitHub Desktop.
diff --git i/input/input.c w/input/input.c
index a578f8c..8f1ba12 100644
--- i/input/input.c
+++ w/input/input.c
@@ -549,9 +549,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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment