From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXuM7-00050x-Es for qemu-devel@nongnu.org; Fri, 25 May 2012 09:15:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXuLz-0000ZV-W8 for qemu-devel@nongnu.org; Fri, 25 May 2012 09:14:59 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:47020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXuLz-0000Yj-Q7 for qemu-devel@nongnu.org; Fri, 25 May 2012 09:14:51 -0400 Received: from /spool/local by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 25 May 2012 07:14:41 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id C33A4C40005 for ; Fri, 25 May 2012 07:14:35 -0600 (MDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4PDEVcM044192 for ; Fri, 25 May 2012 07:14:33 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4PDETLD004297 for ; Fri, 25 May 2012 07:14:29 -0600 Message-ID: <4FBF85AE.9080907@us.ibm.com> Date: Fri, 25 May 2012 08:14:22 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1337916721-14308-1-git-send-email-akong@redhat.com> <1337916721-14308-3-git-send-email-akong@redhat.com> <4FBF01AE.5000007@redhat.com> In-Reply-To: <4FBF01AE.5000007@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] qapi: convert sendkey List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Amos Kong , qemu-devel@nongnu.org, lcapitulino@redhat.com On 05/24/2012 10:51 PM, 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 > >> +## >> +# @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, > > { "execute":"sendky", "data":{ "keys":["ctrl", "alt", "del"], > "hold-time":200 } } Actually, we should do: { 'enum': 'KeyCode', 'data': [ 'map', 'exclam', 'at', 'numbersign', ...] } { 'command': 'sendkey', 'data': { 'keys': [ 'KeyCode' ], '*hold-time': 'int' } } That also has the benefit of making it clear what symbolic names of the keycodes we support are. Regards, Anthony Liguori >