Received: from eggs.gnu.org ([2001:4830:134:3::10]:58955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuzBF-00066q-3k for qemu-devel@nongnu.org; Thu, 12 Jun 2014 03:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuzB7-0007CR-Gi for qemu-devel@nongnu.org; Thu, 12 Jun 2014 03:12:13 -0400 Received: from oxygen.pond.sub.org ([144.76.244.19]:38865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuzB7-0007CL-Ar for qemu-devel@nongnu.org; Thu, 12 Jun 2014 03:12:05 -0400 Received: from blackfin.pond.sub.org (p5B3290AE.dip0.t-ipconnect.de [91.50.144.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by oxygen.pond.sub.org (Postfix) with ESMTPSA id C36EE25C89 for ; Thu, 12 Jun 2014 09:12:04 +0200 (CEST) From: Markus Armbruster References: <20140605232528.GA2566@amt.cnet> <1402388747.8739.41.camel@nilsson.home.kraxel.org> Date: Thu, 12 Jun 2014 09:12:03 +0200 In-Reply-To: <1402388747.8739.41.camel@nilsson.home.kraxel.org> (Gerd Hoffmann's message of "Tue, 10 Jun 2014 10:25:47 +0200") Message-ID: <87egyuzjng.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] add command to position mouse pointer in absolute mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Marcelo Tosatti , qemu-devel , Luiz Capitulino Gerd Hoffmann writes: > Hi, > >> + .name = "mouse_move_abs", >> + .args_type = "dx_str:s,dy_str:s,dz_str:s?", >> + .params = "dx dy [dz]", >> + .help = "send mouse move events (absolute coordinates)", >> + .mhandler.cmd = do_mouse_move_abs, >> + }, >> + >> +STEXI >> +@item mouse_move_abs @var{dx} @var{dy} [@var{dz}] > > I think we should drop the dz parameter (you still can send mouse wheel > events via mouse_move 0 0 dz), and add a optional console parameter > instead ... > >> +static void do_mouse_move_abs(Monitor *mon, const QDict *qdict) >> +{ >> + int dx, dy, dz, button; >> + const char *dx_str = qdict_get_str(qdict, "dx_str"); >> + const char *dy_str = qdict_get_str(qdict, "dy_str"); >> + const char *dz_str = qdict_get_try_str(qdict, "dz_str"); >> + int weight, height; > > ... then pick the console here (if specified): > > QemuConsole *con = NULL; > if (qdict_get_try_str(qdict, "console")) { > con = qemu_console_lookup_by_index(...) > > That's a new hmp-only command tough. IIRC there is (or was?) a policy > that no new hmp-only commands are allowed. Luiz? HMP-only commands are okay only when the functionality they provide does not make sense in QMP. For anything else, we need a QMP command first. The command proper is generally a thin wrapper around an equivalent internal C function. If an HMP command is desired, it should call that C function. [...]