diff options
author | wm4 <wm4@nowhere> | 2014-04-18 18:06:19 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-18 18:06:19 +0200 |
commit | 395fd9aded9e7b5f6ca7e4ccd33a9a17a9131fe1 (patch) | |
tree | 93d9b63c388ca67bf8bd6abde864849be74822ac /input | |
parent | 46966b942dead420789661cd9ab5d961e2aae5d0 (diff) | |
download | mpv-395fd9aded9e7b5f6ca7e4ccd33a9a17a9131fe1.tar.bz2 mpv-395fd9aded9e7b5f6ca7e4ccd33a9a17a9131fe1.tar.xz |
input: remove minor redundancy
Diffstat (limited to 'input')
-rw-r--r-- | input/input.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/input/input.c b/input/input.c index e892f5987b..d7844a79c9 100644 --- a/input/input.c +++ b/input/input.c @@ -531,13 +531,6 @@ static void release_down_cmd(struct input_ctx *ictx, bool drop_current) ictx->last_key_down = 0; ictx->last_key_down_time = 0; ictx->ar_state = -1; -} - -static void release_all(struct input_ctx *ictx) -{ - ictx->last_key_down = 0; - ictx->last_key_down_time = 0; - release_down_cmd(ictx, false); update_mouse_section(ictx); } @@ -596,7 +589,6 @@ static void interpret_key(struct input_ctx *ictx, int code, double scale) return; // Cancel current down-event (there can be only one) release_down_cmd(ictx, true); - update_mouse_section(ictx); cmd = get_cmd_from_keys(ictx, NULL, code); key_buf_add(ictx->key_history, code); if (cmd && should_drop_cmd(ictx, cmd)) { @@ -612,7 +604,7 @@ static void interpret_key(struct input_ctx *ictx, int code, double scale) ictx->current_down_cmd_need_release = false; } else if (state == MP_KEY_STATE_UP) { // Most VOs send RELEASE_ALL anyway - release_all(ictx); + release_down_cmd(ictx, false); } else { // Press of key with no separate down/up events if (ictx->last_key_down == code) { @@ -650,7 +642,7 @@ static void mp_input_feed_key(struct input_ctx *ictx, int code, double scale) { if (code == MP_INPUT_RELEASE_ALL) { MP_DBG(ictx, "release all\n"); - release_all(ictx); + release_down_cmd(ictx, false); return; } if (code == MP_KEY_MOUSE_LEAVE) { |