[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 60/60] ui/sdl2: use correct key names in win title on mac
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 60/60] ui/sdl2: use correct key names in win title on mac |
Date: |
Mon, 6 Nov 2023 12:03:32 +0100 |
From: Adrian Wowk <dev@adrianwowk.com>
Previously, when using the SDL2 UI on MacOS, the title bar uses incorrect
key names (such as Ctrl and Alt instead of the standard MacOS key symbols
like ⌃ and ⌥). This commit changes sdl_update_caption in ui/sdl2.c to
use the correct symbols when compiling for MacOS (CONFIG_DARWIN is
defined).
Unfortunately, standard Mac keyboards do not include a "Right-Ctrl" key,
so in the case that the SDL grab mode is set to HOT_KEY_MOD_RCTRL, the
default text is still used.
Signed-off-by: Adrian Wowk <dev@adrianwowk.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231030024119.28342-1-dev@adrianwowk.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
ui/sdl2.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index fbfdb64e90..4971963f00 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -172,11 +172,19 @@ static void sdl_update_caption(struct sdl2_console *scon)
status = " [Stopped]";
} else if (gui_grab) {
if (alt_grab) {
+#ifdef CONFIG_DARWIN
+ status = " - Press ⌃⌥⇧G to exit grab";
+#else
status = " - Press Ctrl-Alt-Shift-G to exit grab";
+#endif
} else if (ctrl_grab) {
status = " - Press Right-Ctrl-G to exit grab";
} else {
+#ifdef CONFIG_DARWIN
+ status = " - Press ⌃⌥G to exit grab";
+#else
status = " - Press Ctrl-Alt-G to exit grab";
+#endif
}
}
--
2.41.0
- [PULL 50/60] hw/i2c: pmbus: add vout mode bitfields, (continued)
- [PULL 50/60] hw/i2c: pmbus: add vout mode bitfields, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 51/60] hw/i2c: pmbus: add fan support, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 52/60] hw/i2c: pmbus: add VCAP register, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 53/60] hw/sensor: add ADM1266 device model, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 58/60] MAINTAINERS: Add the CAN documentation file to the CAN section, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 57/60] MAINTAINERS: Add include/hw/timer/tmu012.h to the SH4 R2D section, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 55/60] hw/i2c: pmbus: immediately clear faults on request, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 59/60] MAINTAINERS: update libvirt devel mailing list address, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 54/60] tests/qtest: add tests for ADM1266, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 56/60] hw/i2c: pmbus: reset page register for out of range reads, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 60/60] ui/sdl2: use correct key names in win title on mac,
Philippe Mathieu-Daudé <=
- Re: [PULL 00/60] Misc HW/UI patches for 2023-11-06, Stefan Hajnoczi, 2023/11/06