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.
This commit is contained in:
xylosper
2015-01-24 05:45:13 +09:00
committed by wm4
parent a0a40eb287
commit 4a1a0e98d8
4 changed files with 45 additions and 0 deletions

View File

@@ -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}
};