From patchwork Mon Aug 21 20:52:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 9913767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9D275603FA for ; Mon, 21 Aug 2017 20:54:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FE7727C05 for ; Mon, 21 Aug 2017 20:54:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84D6328437; Mon, 21 Aug 2017 20:54:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A2AFB2823D for ; Mon, 21 Aug 2017 20:53:58 +0000 (UTC) Received: from localhost ([::1]:54353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djthf-0002gm-3Q for patchwork-qemu-devel@patchwork.kernel.org; Mon, 21 Aug 2017 16:53:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djtgk-0002fL-B6 for qemu-devel@nongnu.org; Mon, 21 Aug 2017 16:52:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djtgi-00019x-0q for qemu-devel@nongnu.org; Mon, 21 Aug 2017 16:52:46 -0400 Received: from mail-it0-x243.google.com ([2607:f8b0:4001:c0b::243]:32827) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1djtgh-000198-Rf for qemu-devel@nongnu.org; Mon, 21 Aug 2017 16:52:43 -0400 Received: by mail-it0-x243.google.com with SMTP id m81so5460629itb.0 for ; Mon, 21 Aug 2017 13:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UV1jy9buBEV8nMnyoEZIiGIpt0EEQCVMJq58ZA5SiPk=; b=tBHh1l0367Rf4ajzgUICe2bV8+VXuaSo1PxgEAGMAARkNgCO9sl817GMvZffO9l0Uq jcqhuk0nXbFZBd+WMCN7yAsru1+lIF600YaUWg5wGMtdvixavhWi09eN5XCZup5tq0W6 rbZAr9a0L/DzPP2pk5fZindQznETahvwZTSay/Y1//8K4YImp0091UbGzFzcKramywmo N80xkcf7xEM+6zpnpVjYp/tx+eTwbmmPAVC5NTXlpKHCLQ/kJEY0rqS/6JmJOjX7IWZm ofFLl1QxVZfGR4dXaJSDAixWaeo/is/vLjgVPOJc3FzfHdHA3a5IZBeH1NaJJ5Qh5MLM vG2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UV1jy9buBEV8nMnyoEZIiGIpt0EEQCVMJq58ZA5SiPk=; b=IbI5aLpg0xGOUH1DqQn0rVUqVxcnKIc5LdpDcGANJ5Plmjv1qJ73spKHZBIXTbUeS5 WmjM1VewlPTq3F2LdHvRHdDhl77VUyc5YNL0D+kcsV4yggrmpGWyq2MpQCc9uqgELAod 2XPqp63bYzrQyJaoolvr2vxpNrkpLrfBLhuhaF1zLAMGQF2bZe8mvArPyX57XebgXoY2 4FcYkJDKv1bt+KxCWe7oRKSIwKbOLf52ENylQ19w5QaeQM03EYT7cxg3y1ghpgH8KzoD RdCjfKtUuyqkEuUwWDxKKNyAFWQe4J2pbz7vUyZO44Jz5EDP9SLOPpduWoSV9e3rxY5h HKGQ== X-Gm-Message-State: AHYfb5hQCB6FyCLschtwEPRpPWI4PoZJ4ojKFIeSFIvchavJyFmPEeQQ jn12ng3udH4Lu5uE X-Received: by 10.36.37.143 with SMTP id g137mr7201366itg.35.1503348761841; Mon, 21 Aug 2017 13:52:41 -0700 (PDT) Received: from localhost.localdomain (d199-74-164-53.col.wideopenwest.com. [74.199.53.164]) by smtp.gmail.com with ESMTPSA id 27sm6119096ioj.61.2017.08.21.13.52.41 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 21 Aug 2017 13:52:41 -0700 (PDT) From: John Arbuckle To: "qemu-devel@nongnu.org qemu-devel peter . maydell @ linaro . org" Date: Mon, 21 Aug 2017 16:52:25 -0400 Message-Id: <20170821205225.3401-3-programmingkidx@gmail.com> X-Mailer: git-send-email 2.11.0 (Apple Git-81) In-Reply-To: <20170821205225.3401-1-programmingkidx@gmail.com> References: <20170821205225.3401-1-programmingkidx@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::243 Subject: [Qemu-devel] [PATCH 1/2] ui/cocoa.m: move ungrab to ctrl-alt-g X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Arbuckle Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Currently the cocoa user interface relys on the user pushing control-alt to ungrab the mouse. This is patch changes the key combination to control-alt-g to be in line with the GTK user interface. Signed-off-by: John Arbuckle --- ui/cocoa.m | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 93e56d0518..d3e7907103 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -609,10 +609,6 @@ - (void) handleEvent:(NSEvent *)event } } - // release Mouse grab when pressing ctrl+alt - if (([event modifierFlags] & NSEventModifierFlagControl) && ([event modifierFlags] & NSEventModifierFlagOption)) { - [self ungrabMouse]; - } break; case NSEventTypeKeyDown: keycode = cocoa_keycode_to_qemu([event keyCode]); @@ -625,7 +621,7 @@ - (void) handleEvent:(NSEvent *)event // default - // handle control + alt Key Combos (ctrl+alt is reserved for QEMU) + // handle control + alt Key Combos (ctrl+alt+[1..9,g] is reserved for QEMU) if (([event modifierFlags] & NSEventModifierFlagControl) && ([event modifierFlags] & NSEventModifierFlagOption)) { switch (keycode) { @@ -633,6 +629,11 @@ - (void) handleEvent:(NSEvent *)event case Q_KEY_CODE_1 ... Q_KEY_CODE_9: // '1' to '9' keys console_select(keycode - 11); break; + + // release the mouse grab + case Q_KEY_CODE_G: + [self ungrabMouse]; + break; } // handle keys for graphic console @@ -806,9 +807,9 @@ - (void) grabMouse if (!isFullscreen) { if (qemu_name) - [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s - (Press ctrl + alt to release Mouse)", qemu_name]]; + [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s - (Press ctrl + alt + g to release Mouse)", qemu_name]]; else - [normalWindow setTitle:@"QEMU - (Press ctrl + alt to release Mouse)"]; + [normalWindow setTitle:@"QEMU - (Press ctrl + alt + g to release Mouse)"]; } [self hideCursor]; if (!isAbsoluteEnabled) {