Hello Eric, Thanks for your comments.
----- Original Message ----- > On 06/01/2012 04:54 PM, Amos Kong wrote: > > Convert 'sendkey' to use QAPI. do_sendkey() depends on some > > variables/functions in monitor.c, so reserve qmp_sendkey() > > to monitor.c > > > > key_defs[] in monitor.c is the mapping of key name to keycode, > > Keys' order in the enmu and key_defs[] is same. > > > > Signed-off-by: Amos Kong <ak...@redhat.com> > > --- > > > +++ b/qapi-schema.json > > @@ -1755,3 +1755,50 @@ > > # Since: 0.14.0 > > ## > > { 'command': 'device_del', 'data': {'id': 'str'} } > > + > > +## > > +# @KeyCodes: > > +# > > +# An enumeration of key name. > > +# > > +# This is used by the sendkey command. > > +# > > +# Since: 0.14.0 > > Really? Or is this enum since 1.2? Yeah, it should be 1.2 > > > + > > +## > > +# @sendkey: > > +# > > +# Send keys to VM. > > +# > > +# @keys: key sequence > > +# @hold-time: time to delay key up events, milliseconds > > +# > > +# Returns: Nothing on success > > +# If key is unknown or redundant, QERR_INVALID_PARAMETER > > +# If keys number is over the limitation, QERR_OVERFLOW > > +# > > +# Notes: Send keys to the emulator. Keys could be the name of the > > +# key or the raw value in either decimal or hexadecimal format. Use > > +# "-" to press several keys simultaneously. > > These notes don't really correspond to the QMP interface of passing > in a JSON array of simultaneous keys to press. # Notes: Send keys to the emulator. Keys could be the name of the # key or the raw value in either decimal or hexadecimal format. Use # a JSON array to press several keys simultaneously. Ho, I found another bug in my code, key in decimal or hexadecimal format is not supported. I will fix it. > > +# > > +# Since: 0.14.0 > > Again, shouldn't this be 1.2? yeah, 1.2 > > > +SQMP > > +sendkey > > +---------- > > + > > +Send keys to VM. > > + > > +Arguments: > > + > > +keys array: > > + - "key": key sequence (json-string) > > + > > +- hold-time: time to delay key up events, miliseconds (josn-int, > > optional) > > s/miliseconds/milliseconds/ > > -- > Eric Blake ebl...@redhat.com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > >