[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 126/126] ui/cocoa: user friendly characters for release mouse
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 126/126] ui/cocoa: user friendly characters for release mouse |
Date: |
Mon, 27 Feb 2023 15:02:13 +0100 |
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
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>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <E1pAClj-0003Jo-OB@lizzy.crudebyte.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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);
--
2.38.1
- [PULL 120/126] hw/ide/pci: Add PCIIDEState::isa_irq[], (continued)
- [PULL 120/126] hw/ide/pci: Add PCIIDEState::isa_irq[], Philippe Mathieu-Daudé, 2023/02/27
- [PULL 123/126] dump: Clean included headers, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 125/126] dump: Add create_win_dump() stub for non-x86 targets, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 110/126] hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 113/126] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h', Philippe Mathieu-Daudé, 2023/02/27
- [PULL 121/126] dump: Replace tswapN() -> cpu_to_dumpN(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 119/126] hw/ide/via: Replace magic 2 value by ARRAY_SIZE / MAX_IDE_DEVS, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 122/126] dump: Replace TARGET_PAGE_SIZE -> qemu_target_page_size(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 124/126] dump: Simplify compiling win_dump.o by introducing win_dump_available(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 117/126] hw/ide/piix: Pass Error* to pci_piix_init_ports() for better error msg, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 126/126] ui/cocoa: user friendly characters for release mouse,
Philippe Mathieu-Daudé <=
- Re: [RESEND PULL 000/126] Buildsys / QOM / QDev / UI patches for 2023-02-27, Peter Maydell, 2023/02/27