From patchwork Mon Feb 27 14:02:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 657050 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2377440wrb; Mon, 27 Feb 2023 06:20:54 -0800 (PST) X-Google-Smtp-Source: AK7set8gUj09EUNnKC32NehNPSIV98UOKtzYAOwPUKxFiaI5ODdXi0rqxl6X+/xi941sirWBexBm X-Received: by 2002:a05:6102:150e:b0:412:f05:675b with SMTP id f14-20020a056102150e00b004120f05675bmr4582252vsv.15.1677507653933; Mon, 27 Feb 2023 06:20:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677507653; cv=none; d=google.com; s=arc-20160816; b=AP6GGuV2DSa4l2rKeoA5gNiG6zzMBMRSzghsIu1Mmp7f5gQ9cBTuvkKHtxQU0WeIVW ZDLt9focRIiW5EdmJUFJ0PV7r9Ckt0Hy0ydlgQdX3p9Gq97b59LwokZaPWyv0q6pJ+qt iVloiiUvSHAR4Cs5+VAEF7KVZsghI7rAuHguxvRr5moURn4zkIiLLit8HLRBLBMTlqRU 8HIH7Yb0IEz95AryWoIdlRI4i7cNkv75XDWOnybBvT3n2bZ2AW0C82gRktRC7Qt1YHo6 Oh2vRgwfU4DPRXI9w/6E313ich1xBcWlNOV9ynafm2PWWbmUBMZax+2TA4l2y9z734nM qQsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ky6Vfjb7nqfdzoG0sGMRpKArH4PwqBfUvvv4AQpaXAo=; b=pBUK07KQWotZE5umc9m8LyQIVfzQYzJDqj/KIhZMxfX10QTl0NuWCY2P8OjRKOycpf VakEfBC0ZBlLotAj6SHfSzdO2QTxneodBgesmH/HflwN8pLvmlC9oNQagsDzSd+omITE SQUCiQCj82P5oEpKezxf2ue8wXR0TH8pnpQ73c9LcoUlHrmQJWqV56qMb+b1TQkaot4K Sqtz8TVtB/wEOwSUN6QRpSMjGaxTt6ne2C6Qooie2NHkkzbxcqUc0lhMjIY1xdsXHIoy hVNIA4UNfvOprwysiwQ27cgV1y5rrz92qJ1p8IxvFJaTTXqhLsAPDgxVnHiWRilQS6N/ s3eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=up0NhAZU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bh18-20020a056102357200b00411fb5055a9si2154982vsb.344.2023.02.27.06.20.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 06:20:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=up0NhAZU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWeFy-0004kK-Q2; Mon, 27 Feb 2023 09:13:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWeFG-0001Hk-In for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:12:52 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWeFE-0001JX-Qf for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:12:50 -0500 Received: by mail-wr1-x42f.google.com with SMTP id bv17so6381247wrb.5 for ; Mon, 27 Feb 2023 06:12:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ky6Vfjb7nqfdzoG0sGMRpKArH4PwqBfUvvv4AQpaXAo=; b=up0NhAZUHLAcaAocudB2yV6otzA4+WPraXMi9nAr72tD1Mp2HXmLsSCch6AY3mR6uD Ut27ne1sZ/y7cDCseMbMlpfq44ELBxcbzCqRbr2WyFwS6OffxUAXCIPL+tTv/bYM6dZf LdwhJ6tOvoUgIifaGF0UXVeEtXlpmLSBiaQ1Cubz8GhSJ1hNPibhshMKXzlf+spmWsLD KHp8JX4Eydhuz16OwhrcblP5GzS3CwWkBLCt7zT0e0fmu6zdGK+echpHNOeQMKZ0Tjuo WiZHVkocufn4ulv5g4qT5XbM1EZHo60XAFqi/xhEM3GGvtDTrMX+M3LIN+kRy1o5nj7o uWYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ky6Vfjb7nqfdzoG0sGMRpKArH4PwqBfUvvv4AQpaXAo=; b=6cuVWA+SxJvf8/nVOuh1E5yjmnYGZ13KKopXQKE+M9BpzqC/DaQZsUGWBRxvTjEXRW H6tdnBNDlprm9l+U2llY5JWdtbgjT6NKS0rg0chv3lXMdpCHMqhJ8jhpxx6FcCWCEy2r JSB1kcwmSW7YspZ27cVks/1HXCPjaw5m9ldQXL1BYApQzAmj+OwQuQRA/5mGYyKVms73 F+AIDuLC9Gsi4N3t8qnbZz1ziEWXLobosg8L2j3PR3bAwivxL5na6IBWYHgOSdz72dxY HFsU114RCwYQJDgWjp+LV3xmFnDTPjHJlOjRilowZun8G7JnaR2G2o8+HbpkwngKIK/O CcdQ== X-Gm-Message-State: AO0yUKUBWpmSlIP8BeCmKPikZ5l7hC0C7ROQjnKufOY579+52q5mqk9D 92xQCeKAgUaYHQDUJiplXGapnwNwdWlFoN6+ X-Received: by 2002:a5d:58cd:0:b0:2c7:5247:e496 with SMTP id o13-20020a5d58cd000000b002c75247e496mr9756639wrf.60.1677507167930; Mon, 27 Feb 2023 06:12:47 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id i20-20020a5d5234000000b002c5493a17efsm7331677wra.25.2023.02.27.06.12.46 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Feb 2023 06:12:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 126/126] ui/cocoa: user friendly characters for release mouse Date: Mon, 27 Feb 2023 15:02:13 +0100 Message-Id: <20230227140213.35084-117-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230227140213.35084-1-philmd@linaro.org> References: <20230227140213.35084-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Christian Schoenebeck While mouse is grabbed, window title contains a hint for the user what keyboard keys to press to release the mouse. Make that hint text a bit more user friendly for a Mac user: - Replace "Ctrl" and "Alt" by appropriate symbols for those keyboard keys typically displayed for them on a Mac (encode those symbols by using UTF-8 characters). - Drop " + " in between the keys, as that's not common on macOS for documenting keyboard shortcuts. - Convert lower case "g" to upper case "G", as that's common on macOS. - Add one additional space at start and end of key stroke set, to visually separate the key strokes from the rest of the text. Signed-off-by: Christian Schoenebeck Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Message-Id: Signed-off-by: Philippe Mathieu-Daudé --- ui/cocoa.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index e915c344a8..289a2b193e 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -72,6 +72,9 @@ #define cgrect(nsrect) (*(CGRect *)&(nsrect)) +#define UC_CTRL_KEY "\xe2\x8c\x83" +#define UC_ALT_KEY "\xe2\x8c\xa5" + typedef struct { int width; int height; @@ -1135,9 +1138,9 @@ - (void) grabMouse if (!isFullscreen) { if (qemu_name) - [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s - (Press ctrl + alt + g to release Mouse)", qemu_name]]; + [normalWindow setTitle:[NSString stringWithFormat:@"QEMU %s - (Press " UC_CTRL_KEY " " UC_ALT_KEY " G to release Mouse)", qemu_name]]; else - [normalWindow setTitle:@"QEMU - (Press ctrl + alt + g to release Mouse)"]; + [normalWindow setTitle:@"QEMU - (Press " UC_CTRL_KEY " " UC_ALT_KEY " G to release Mouse)"]; } [self hideCursor]; CGAssociateMouseAndMouseCursorPosition(isAbsoluteEnabled);