Trivial.
Showing the changes to input/input.c (1 of 2 files). Show all
Unified · Split
| @@ -598,7 +598,8 @@ static void interpret_key(struct input_ctx *ictx, int code, double scale, · 597 unmodified lines | |||
| 598 | int scale_units) | 598 | int scale_units) |
| 599 | { | 599 | { |
| 600 | int state = code & (MP_KEY_STATE_DOWN | MP_KEY_STATE_UP); | 600 | int state = code & (MP_KEY_STATE_DOWN | MP_KEY_STATE_UP); |
| 601 | code = code & ~(unsigned)state; | 601 | bool no_emit = code & MP_KEY_STATE_SET_ONLY; |
| 602 | code = code & ~(unsigned)(state | MP_KEY_STATE_SET_ONLY); | ||
| 602 | 603 | ||
| 603 | if (mp_msg_test(ictx->log, MSGL_TRACE)) { | 604 | if (mp_msg_test(ictx->log, MSGL_TRACE)) { |
| 604 | char *key = mp_input_get_key_name(code); | 605 | char *key = mp_input_get_key_name(code); |
| @@ -648,9 +649,10 @@ static void interpret_key(struct input_ctx *ictx, int code, double scale, · 43 unmodified lines | |||
| 648 | return; | 649 | return; |
| 649 | 650 | ||
| 650 | // Don't emit a command on key-down if the key is designed to emit commands | 651 | // Don't emit a command on key-down if the key is designed to emit commands |
| 651 | // on key-up (like mouse buttons). Also, if the command specifically should | 652 | // on key-up (like mouse buttons), or setting key state only without emitting commands. |
| 652 | // be sent both on key down and key up, still emit the command. | 653 | // Also, if the command specifically should be sent both on key down and key up, |
| 653 | if (cmd->emit_on_up && !cmd->def->on_updown) { | 654 | // still emit the command. |
| 655 | if ((cmd->emit_on_up && !cmd->def->on_updown) || no_emit) { | ||
| 654 | talloc_free(cmd); | 656 | talloc_free(cmd); |
| 655 | return; | 657 | return; |
| 656 | } | 658 | } |