summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-04 23:01:15 +0100
committerwm4 <wm4@nowhere>2016-02-04 23:01:15 +0100
commitb4f63cbbec563e46ef01899b7292e301e961ec1d (patch)
tree0ada8fe035790c43c9fe96bfa45307036967d592 /player/command.c
parent155f7fac9dd8d756656a05376da9495e1348daad (diff)
downloadmpv-b4f63cbbec563e46ef01899b7292e301e961ec1d.tar.bz2
mpv-b4f63cbbec563e46ef01899b7292e301e961ec1d.tar.xz
input: ignore --input-cursor for events injected by input commands
Apparently useful for window embedding. Fixes #2750.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/player/command.c b/player/command.c
index c95e7d1315..997d60591c 100644
--- a/player/command.c
+++ b/player/command.c
@@ -5046,7 +5046,7 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
const int x = cmd->args[0].v.i, y = cmd->args[1].v.i;
int button = cmd->args[2].v.i;
if (button == -1) {// no button
- mp_input_set_mouse_pos(mpctx->input, x, y);
+ mp_input_set_mouse_pos_artificial(mpctx->input, x, y);
break;
}
if (button < 0 || button >= 20) {// invalid button
@@ -5055,8 +5055,8 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
}
const bool dbc = cmd->args[3].v.i;
button += dbc ? MP_MOUSE_BASE_DBL : MP_MOUSE_BASE;
- mp_input_set_mouse_pos(mpctx->input, x, y);
- mp_input_put_key(mpctx->input, button);
+ mp_input_set_mouse_pos_artificial(mpctx->input, x, y);
+ mp_input_put_key_artificial(mpctx->input, button);
break;
}
@@ -5071,21 +5071,21 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
if (cmd->id == MP_CMD_KEYDOWN)
code |= MP_KEY_STATE_DOWN;
- mp_input_put_key(mpctx->input, code);
+ mp_input_put_key_artificial(mpctx->input, code);
break;
}
case MP_CMD_KEYUP: {
const char *key_name = cmd->args[0].v.s;
if (key_name[0] == '\0') {
- mp_input_put_key(mpctx->input, MP_INPUT_RELEASE_ALL);
+ mp_input_put_key_artificial(mpctx->input, MP_INPUT_RELEASE_ALL);
} else {
int code = mp_input_get_key_from_name(key_name);
if (code < 0) {
MP_ERR(mpctx, "%s is not a valid input name.\n", key_name);
return -1;
}
- mp_input_put_key(mpctx->input, code | MP_KEY_STATE_UP);
+ mp_input_put_key_artificial(mpctx->input, code | MP_KEY_STATE_UP);
}
break;
}