diff options
author | xylosper <darklin20@gmail.com> | 2015-01-24 05:45:13 +0900 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-23 22:07:47 +0100 |
commit | 4a1a0e98d8f7ce8e1ab61ff740699cce9bb43f70 (patch) | |
tree | f09036422b389247b0dbfa5f231bbeea8f09998f /input/cmd_list.c | |
parent | a0a40eb2872d137898e6f96b8d46490f2e63071f (diff) | |
download | mpv-4a1a0e98d8f7ce8e1ab61ff740699cce9bb43f70.tar.bz2 mpv-4a1a0e98d8f7ce8e1ab61ff740699cce9bb43f70.tar.xz |
input, player: new command for mouse event
New command `mouse <x> <y> [<button> [single|double]]` is introduced.
This will update mouse position with given coordinate (`<x>`, `<y>`),
and additionally, send single-click or double-click event if `<button>`
is given.
Diffstat (limited to 'input/cmd_list.c')
-rw-r--r-- | input/cmd_list.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/input/cmd_list.c b/input/cmd_list.c index fc0ef17ed5..376f330ce2 100644 --- a/input/cmd_list.c +++ b/input/cmd_list.c @@ -186,6 +186,13 @@ const struct mp_cmd_def mp_cmds[] = { { MP_CMD_HOOK_ADD, "hook_add", { ARG_STRING, ARG_INT, ARG_INT } }, { MP_CMD_HOOK_ACK, "hook_ack", { ARG_STRING } }, + { MP_CMD_MOUSE, "mouse", { + ARG_INT, ARG_INT, // coordinate (x, y) + OARG_INT(-1), // button number + OARG_CHOICE(0, ({"single", 0}, + {"double", 1})), + }}, + {0} }; |