On 25/05/12 11:51, Eric Blake wrote:
On 05/24/2012 09:32 PM, Amos Kong wrote:
Convert 'sendkey' to use. do_sendkey() depends on some variables
in monitor.c, so reserve qmp_sendkey() to monitor.c
Rename 'string' to 'keys', rename 'hold_time' to 'hold-time'
Signed-off-by: Amos Kong<ak...@redhat.com>
+##
+# @sendkey:
+#
+# Send keys to VM.
+#
+# @keys: key sequence
+# @hold-time: time to delay key up events
+#
+# Returns: Nothing on success
+# If key is unknown or redundant, QERR_INVALID_PARAMETER
+# If key is invalid, QERR_INVALID_PARAMETER_VALUE
+#
+# Notes: Send @var{keys} to the emulator. @var{keys} could be the name of the
+# key or the raw value in either decimal or hexadecimal format. Use
+# @code{-} to press several keys simultaneously.
+#
+# Since: 0.14.0
+##
+{ 'command': 'sendkey', 'data': {'keys': 'str', '*hold-time': 'int'} }
Rather than making 'keys' a free-form string where qemu then has to
parse '-' to separate keys, should we instead make it a JSON array? For
example,
Anthony, Luiz, Daniel, what's your opinion?
{ "execute":"sendkey", "data":{ "keys":["ctrl", "alt", "del"],
"hold-time":200 } }
How to make it compatible with hum command? Still use 'ctrl-alt-delete'
for hum, separate keys and generate an array in hum_sendkey() before
calling qmp_sendkey()?
And I'm know clear about how to define command in qapi-schema.json,
I didn't find exist example, any clue?
{ 'command': 'sendkey', 'data': { 'keys': [ 'str'], '*hold-time':
'int'} }
--
{ 'type': 'Key', 'data': {'name': 'str'} }
{ 'command': 'sendkey', 'data': { 'keys': [ 'Key' ], '*hold-time':
'int'} }
--
Amos.