[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/16] qemu-char: add support for U-prefixed symbols
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 03/16] qemu-char: add support for U-prefixed symbols |
Date: |
Wed, 13 Nov 2013 17:01:07 +0400 |
From: Jan Krupa <address@hidden>
This patch adds support for Unicode symbols in keymap files. This
feature was already used in some keyboard layouts in QEMU generated
from XKB (e.g. Arabic) but it wasn't implemented in QEMU source code.
There is no need for check of validity of the hex string after U character
because strtol returns 0 in case the conversion was unsuccessful.
Signed-off-by: Jan Krupa <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
ui/keymaps.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/ui/keymaps.c b/ui/keymaps.c
index f373cc5..80d658d 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -33,6 +33,12 @@ static int get_keysym(const name2keysym_t *table,
if (!strcmp(p->name, name))
return p->keysym;
}
+ if (name[0] == 'U' && strlen(name) == 5) { /* try unicode Uxxxx */
+ char *end;
+ int ret = (int)strtoul(name + 1, &end, 16);
+ if (*end == '\0' && ret > 0)
+ return ret;
+ }
return 0;
}
--
1.7.10.4
- [Qemu-devel] [PULL 00/16] [for-1.7] Trivial patches for 2013-11-13, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 02/16] qemu-char: add Czech keymap file, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 10/16] qga: Fix compilation for old versions of MinGW, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 01/16] qemu-char: add Czech characters to VNC keysyms, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 03/16] qemu-char: add support for U-prefixed symbols,
Michael Tokarev <=
- [Qemu-devel] [PULL 04/16] qemu-char: add missing characters used in keymaps, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 07/16] qapi: Fix comment for create-type to match code., Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 13/16] trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies), Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 11/16] console: Remove unused debug code, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 15/16] gtk: Replace conditional debug messages by trace methods, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 09/16] .travis.yml: basic compile and check recipes, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 06/16] vl: fix build when configured with no graphic support, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 05/16] usb: drop unused USBNetState.inpkt field, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 16/16] qga: Fix shutdown command of guest agent to work with SysV, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 12/16] trace: Remove trace.h from console.h (less dependencies), Michael Tokarev, 2013/11/13