From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wws3Y-0000gv-0L for qemu-devel@nongnu.org; Tue, 17 Jun 2014 08:00:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wws3Q-0003By-0K for qemu-devel@nongnu.org; Tue, 17 Jun 2014 08:00:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wws3P-0003Bu-ON for qemu-devel@nongnu.org; Tue, 17 Jun 2014 07:59:55 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5HBxrTh028606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 17 Jun 2014 07:59:54 -0400 Message-ID: <53A02DB9.5060404@redhat.com> Date: Tue, 17 Jun 2014 05:59:53 -0600 From: Eric Blake MIME-Version: 1.0 References: <20140616231509.GA24935@amt.cnet> In-Reply-To: <20140616231509.GA24935@amt.cnet> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2CQP7nieCwIKI0cFuSD6d9Ta4gD6URDVX" Subject: Re: [Qemu-devel] [PATCH] add input-send-event command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti , qemu-devel Cc: Gerd Hoffmann , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2CQP7nieCwIKI0cFuSD6d9Ta4gD6URDVX Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/16/2014 05:15 PM, Marcelo Tosatti wrote: >=20 > Which allows specification of absolute/relative,=20 > up/down and console parameters. >=20 > Suggested by Gerd Hoffman. >=20 > --- Needs S-o-B. > qapi-schema.json | 18 ++++++++++++++++ > qmp-commands.hx | 59 ++++++++++++++++++++++++++++++++++++++++++++++= +++++++++ > ui/input.c | 31 ++++++++++++++++++++++++++++ > 3 files changed, 108 insertions(+) >=20 > Index: qemu/qapi-schema.json > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- qemu.orig/qapi-schema.json 2014-06-16 20:12:51.049064621 -0300 > +++ qemu/qapi-schema.json 2014-06-16 20:13:42.886920723 -0300 > @@ -4722,3 +4722,21 @@ > 'btn' : 'InputBtnEvent', > 'rel' : 'InputMoveEvent', > 'abs' : 'InputMoveEvent' } } > + > +## > +# @input-send-event > +# > +# Send input event(s) to guest. > +# > +# @console: Which console to send event(s) to. Is it worth requiring console, or can it be optional and default to the first available console (usually console 0)? > +# > +# @events: List of InputEvent union. > +# > +# Returns: Nothing on success. > +# > +# Since: 2.1 > +# > +## > +{ 'command': 'input-send-event', > + 'data': { 'console':'int', 'events': [ 'InputEvent' ] } } See my other mail about possibly extending the InputEvent union (or creating a new subtype) to add delays into the mix. > +Example (2): > + > +Press ctrl-alt-del. > + > +-> { "execute": "input-send-event", > + "arguments": { "console": 0, "events": [ > + { "type": "key", "data" : { "down": true, > + "key": {"type": "qcode", "data": "ctrl" } } }, > + { "type": "key", "data" : { "down": true, > + "key": {"type": "qcode", "data": "alt" } } }, > + { "type": "key", "data" : { "down": true, > + "key": {"type": "qcode", "data": "delete" } } } ] } } > +<- { "return": {} } Don't you also need to send the key-release events (again, possibly after a pause), for this to work? > + if (!qemu_input_find_handler(1 << event->kind, con)) { > + error_setg(errp, "Input handler not found for" > + "event type %s", Typo: s/forevent/for event/ --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --2CQP7nieCwIKI0cFuSD6d9Ta4gD6URDVX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJToC25AAoJEKeha0olJ0NqhUcIAJ5p2LRfTlO0CU5qSCv5nUWb 79G8C2stY7bDNT14CqO4wVztLVrIxT3hrp5bK1RC7HDlcvH0IXdxVazglfaOlvSA Rw2OKQlnFNlcsBW0Xje58J2xU/1phMHc1PEC3FbV8VztQT3vTlxMzFSSKR7s0efg LCurTLAEDrRg6qEDYanI1kq2qHxl5hwEx5uONoBewi0Fwv7NmDRAmKwmWNot9kHU rWEcI9gcg3SF/McrECYQ2vHRmSiHV+IQzot9DeS94uul1KRmhOaFLowXnQN77yx8 N/KP3qftPZecSl64beWa0k8Sm9LSlsJ3cE2ggvBs2vIvge3xCkDf8i1nskMb0Z0= =z7pp -----END PGP SIGNATURE----- --2CQP7nieCwIKI0cFuSD6d9Ta4gD6URDVX--