qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: "Akihiko Odaki" <akihiko.odaki@gmail.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] ui/cocoa: user friendly characters for release mouse
Date: Fri, 30 Dec 2022 15:01:56 +0100	[thread overview]
Message-ID: <2747646.NkXQSxgv1M@silver> (raw)
In-Reply-To: <50787eef-d8a2-2790-749c-407e90e1d46f@linaro.org>

On Thursday, December 29, 2022 1:31:09 PM CET Philippe Mathieu-Daudé wrote:
> On 27/12/22 17:15, Christian Schoenebeck wrote:
> > 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 <qemu_oss@crudebyte.com>
> > ---
> >   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]];
> 
> I was a bit confused by the control symbol at first and tough
> I had to press '^'; thus I'm not sure keeping 'ctrl' wouldn't
> be clearer. The UC_ALT_KEY symbol certainly is. Anyhow,

It _should_ be clear to Mac users that "^" == "control" key on a Mac keyboard,
as that's how it is presented for keyboard shortcuts in all Mac menus. But if
it's really irritating then we can also revert that to either "Ctrl" or
"control". It's a quick change.

I just got itched by the "Alt" hint actually, which is not printed on any Mac
keyboard.

> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Thanks!

> >           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);
> 
> 
> 




  reply	other threads:[~2022-12-30 14:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 16:15 [PATCH] ui/cocoa: user friendly characters for release mouse Christian Schoenebeck
2022-12-29  9:24 ` Christian Schoenebeck
2022-12-29 12:31 ` Philippe Mathieu-Daudé
2022-12-30 14:01   ` Christian Schoenebeck [this message]
2023-02-27 11:28 ` Christian Schoenebeck
2023-03-13 12:26   ` Christian Schoenebeck
2023-03-13 13:42     ` BALATON Zoltan
2023-03-13 13:53       ` Christian Schoenebeck
2023-03-13 14:38         ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2747646.NkXQSxgv1M@silver \
    --to=qemu_oss@crudebyte.com \
    --cc=akihiko.odaki@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).