From d0fe5e08b984db840545c1b341a1e56fad304593 Mon Sep 17 00:00:00 2001 From: torque Date: Wed, 10 Jun 2015 16:56:56 -0700 Subject: command: add keypress, keydown, and keyup commands. These commands are used to simulate keypresses using the key names from input.conf. --- input/cmd_list.c | 3 +++ input/cmd_list.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'input') diff --git a/input/cmd_list.c b/input/cmd_list.c index ec6b6f936a..c5249eb6f4 100644 --- a/input/cmd_list.c +++ b/input/cmd_list.c @@ -203,6 +203,9 @@ const struct mp_cmd_def mp_cmds[] = { OARG_CHOICE(0, ({"single", 0}, {"double", 1})), }}, + { MP_CMD_KEYPRESS, "keypress", { ARG_STRING } }, + { MP_CMD_KEYDOWN, "keydown", { ARG_STRING } }, + { MP_CMD_KEYUP, "keyup", { OARG_STRING("") } }, { MP_CMD_AUDIO_ADD, "audio-add", { ARG_STRING, OARG_CHOICE(0, ({"select", 0}, {"auto", 1}, {"cached", 2})), diff --git a/input/cmd_list.h b/input/cmd_list.h index fad635f0b2..5870ff584b 100644 --- a/input/cmd_list.h +++ b/input/cmd_list.h @@ -87,6 +87,9 @@ enum mp_command_type { MP_CMD_DROP_BUFFERS, MP_CMD_MOUSE, + MP_CMD_KEYPRESS, + MP_CMD_KEYDOWN, + MP_CMD_KEYUP, /// Audio Filter commands MP_CMD_AF, -- cgit v1.2.3