All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH 0/3] qemu-char: keymap changes for Czech and Unicode support
@ 2013-08-27 15:14 ` Jan Krupa
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Krupa @ 2013-08-27 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Jan Krupa, anthony

I tried to create keymap for Czech keyboard for QEMU. I found out that
some of the keysyms are missing. I added those specific symbols to QEMU
VNC header files plus wrote the whole keyboard layout.

Another issue I hit during keyboard layout creation process is that keysym
to keycode converter inside QEMU doesn't handle U-prefixed Unicode symbols
which are already used for example in Arabic keymap file (pc-bios/keymaps/ar).
I implemented support for handling these characters.

Jan Krupa (3):
  qemu-char: add Czech characters to VNC keysyms
  qemu-char: add Czech keymap file
  qemu-char: add support for U-prefixed symbols

 pc-bios/keymaps/cz |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 ui/keymaps.c       |    3 ++
 ui/vnc_keysym.h    |    8 ++++
 3 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 pc-bios/keymaps/cz



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH 0/3] qemu-char: keymap changes for Czech and Unicode support
@ 2013-08-27 15:14 ` Jan Krupa
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Krupa @ 2013-08-27 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Jan Krupa, anthony

I tried to create keymap for Czech keyboard for QEMU. I found out that
some of the keysyms are missing. I added those specific symbols to QEMU
VNC header files plus wrote the whole keyboard layout.

Another issue I hit during keyboard layout creation process is that keysym
to keycode converter inside QEMU doesn't handle U-prefixed Unicode symbols
which are already used for example in Arabic keymap file (pc-bios/keymaps/ar).
I implemented support for handling these characters.

Jan Krupa (3):
  qemu-char: add Czech characters to VNC keysyms
  qemu-char: add Czech keymap file
  qemu-char: add support for U-prefixed symbols

 pc-bios/keymaps/cz |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 ui/keymaps.c       |    3 ++
 ui/vnc_keysym.h    |    8 ++++
 3 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 pc-bios/keymaps/cz

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-trivial] [PATCH 1/3] qemu-char: add Czech characters to VNC keysyms
  2013-08-27 15:14 ` [Qemu-devel] " Jan Krupa
@ 2013-08-27 15:14   ` Jan Krupa
  -1 siblings, 0 replies; 12+ messages in thread
From: Jan Krupa @ 2013-08-27 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Jan Krupa, anthony

This patch adds missing Czech characters to VNC keysym table.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
---
 ui/vnc_keysym.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ui/vnc_keysym.h b/ui/vnc_keysym.h
index 6250bec..72c01d1 100644
--- a/ui/vnc_keysym.h
+++ b/ui/vnc_keysym.h
@@ -224,6 +224,14 @@ static const name2keysym_t name2keysym[]={
 { "odoubleacute",         0x1f5},
 { "udoubleacute",         0x1fb},
 
+/* Czech national characters */
+{ "ecaron",               0x1ec},
+{ "scaron",               0x1b9},
+{ "ccaron",               0x1e8},
+{ "rcaron",               0x1f8},
+{ "zcaron",               0x1be},
+{ "uring",                0x1f9},
+
     /* modifiers */
 {"ISO_Level3_Shift", 0xfe03}, /* XK_ISO_Level3_Shift */
 {"Control_L", 0xffe3}, /* XK_Control_L */
-- 
1.6.0.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH 1/3] qemu-char: add Czech characters to VNC keysyms
@ 2013-08-27 15:14   ` Jan Krupa
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Krupa @ 2013-08-27 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Jan Krupa, anthony

This patch adds missing Czech characters to VNC keysym table.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
---
 ui/vnc_keysym.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/ui/vnc_keysym.h b/ui/vnc_keysym.h
index 6250bec..72c01d1 100644
--- a/ui/vnc_keysym.h
+++ b/ui/vnc_keysym.h
@@ -224,6 +224,14 @@ static const name2keysym_t name2keysym[]={
 { "odoubleacute",         0x1f5},
 { "udoubleacute",         0x1fb},
 
+/* Czech national characters */
+{ "ecaron",               0x1ec},
+{ "scaron",               0x1b9},
+{ "ccaron",               0x1e8},
+{ "rcaron",               0x1f8},
+{ "zcaron",               0x1be},
+{ "uring",                0x1f9},
+
     /* modifiers */
 {"ISO_Level3_Shift", 0xfe03}, /* XK_ISO_Level3_Shift */
 {"Control_L", 0xffe3}, /* XK_Control_L */
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-trivial] [PATCH 2/3] qemu-char: add Czech keymap file
  2013-08-27 15:14   ` [Qemu-devel] " Jan Krupa
@ 2013-08-27 15:14     ` Jan Krupa
  -1 siblings, 0 replies; 12+ messages in thread
From: Jan Krupa @ 2013-08-27 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Jan Krupa, anthony

This patch adds Czech keyboard layout to available keymap files.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
---
 pc-bios/keymaps/cz |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 pc-bios/keymaps/cz

diff --git a/pc-bios/keymaps/cz b/pc-bios/keymaps/cz
new file mode 100644
index 0000000..6584bfb
--- /dev/null
+++ b/pc-bios/keymaps/cz
@@ -0,0 +1,94 @@
+include common
+
+# Czech qwertz layout
+# comments are czech descriptions of the characters
+
+# -----------
+#  First row
+# -----------
+
+# strednik, kolecko
+semicolon 0x29
+dead_abovering 0x29 shift
+
+# numbers
+plus 0x2
+1 0x2 shift
+ecaron 0x3
+2 0x3 shift
+scaron 0x4
+3 0x4 shift
+ccaron 0x5
+4 0x5 shift
+rcaron 0x6
+5 0x6 shift
+zcaron 0x7
+6 0x7 shift
+yacute 0x8
+7 0x8 shift
+aacute 0x9
+8 0x9 shift
+iacute 0xa
+9 0xa shift
+eacute 0xb
+0 0xb shift
+
+# rovnitko
+equal 0x0c
+percent 0x0c shift
+
+# carka, hacek
+dead_acute 0x0d
+dead_caron 0x0d shift
+
+# ------------
+#  Second row
+# ------------
+
+z 0x15 addupper
+
+# u s carkou, zpetne lomitko
+uacute 0x1a
+slash 0x1a shift
+
+# prava zavorka, leva zavorka
+parenright 0x1b
+parenleft 0x1b shift
+
+# -----------
+#  Third row
+# -----------
+
+# u s krouzkem, uvozovky
+uring 0x27
+quotedbl 0x27 shift
+
+# paragraf, vykricnik
+section 0x28
+exclam 0x28 shift
+
+# vodorovna dvojtecka, apostrof
+dead_diaeresis 0x2b
+apostrophe 0x2b shift
+
+# ------------
+#  Fourth row
+# ------------
+
+# zpetne lomitko, roura
+backslash 0x2b
+bar 0x2b shift
+
+y 0x2c addupper
+
+# carka, otaznik
+comma 0x33
+question 0x33 shift
+
+# tecka, dvojtecka
+period 0x34
+colon 0x34 shift
+
+# minus, podtrzitko
+minus 0x35
+underscore 0x35 shift
-- 
1.6.0.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH 2/3] qemu-char: add Czech keymap file
@ 2013-08-27 15:14     ` Jan Krupa
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Krupa @ 2013-08-27 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Jan Krupa, anthony

This patch adds Czech keyboard layout to available keymap files.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
---
 pc-bios/keymaps/cz |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 94 insertions(+), 0 deletions(-)
 create mode 100644 pc-bios/keymaps/cz

diff --git a/pc-bios/keymaps/cz b/pc-bios/keymaps/cz
new file mode 100644
index 0000000..6584bfb
--- /dev/null
+++ b/pc-bios/keymaps/cz
@@ -0,0 +1,94 @@
+include common
+
+# Czech qwertz layout
+# comments are czech descriptions of the characters
+
+# -----------
+#  First row
+# -----------
+
+# strednik, kolecko
+semicolon 0x29
+dead_abovering 0x29 shift
+
+# numbers
+plus 0x2
+1 0x2 shift
+ecaron 0x3
+2 0x3 shift
+scaron 0x4
+3 0x4 shift
+ccaron 0x5
+4 0x5 shift
+rcaron 0x6
+5 0x6 shift
+zcaron 0x7
+6 0x7 shift
+yacute 0x8
+7 0x8 shift
+aacute 0x9
+8 0x9 shift
+iacute 0xa
+9 0xa shift
+eacute 0xb
+0 0xb shift
+
+# rovnitko
+equal 0x0c
+percent 0x0c shift
+
+# carka, hacek
+dead_acute 0x0d
+dead_caron 0x0d shift
+
+# ------------
+#  Second row
+# ------------
+
+z 0x15 addupper
+
+# u s carkou, zpetne lomitko
+uacute 0x1a
+slash 0x1a shift
+
+# prava zavorka, leva zavorka
+parenright 0x1b
+parenleft 0x1b shift
+
+# -----------
+#  Third row
+# -----------
+
+# u s krouzkem, uvozovky
+uring 0x27
+quotedbl 0x27 shift
+
+# paragraf, vykricnik
+section 0x28
+exclam 0x28 shift
+
+# vodorovna dvojtecka, apostrof
+dead_diaeresis 0x2b
+apostrophe 0x2b shift
+
+# ------------
+#  Fourth row
+# ------------
+
+# zpetne lomitko, roura
+backslash 0x2b
+bar 0x2b shift
+
+y 0x2c addupper
+
+# carka, otaznik
+comma 0x33
+question 0x33 shift
+
+# tecka, dvojtecka
+period 0x34
+colon 0x34 shift
+
+# minus, podtrzitko
+minus 0x35
+underscore 0x35 shift
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-trivial] [PATCH 3/3] qemu-char: add support for U-prefixed symbols
  2013-08-27 15:14     ` [Qemu-devel] " Jan Krupa
@ 2013-08-27 15:14       ` Jan Krupa
  -1 siblings, 0 replies; 12+ messages in thread
From: Jan Krupa @ 2013-08-27 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Jan Krupa, anthony

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.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
---
 ui/keymaps.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/ui/keymaps.c b/ui/keymaps.c
index f373cc5..426a893 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -33,6 +33,9 @@ static int get_keysym(const name2keysym_t *table,
         if (!strcmp(p->name, name))
             return p->keysym;
     }
+    if (strlen(name) == 5 && name[0] == 'U') {
+        return (int)strtol(name + 1, NULL, 16);
+    }
     return 0;
 }
 
-- 
1.6.0.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PATCH 3/3] qemu-char: add support for U-prefixed symbols
@ 2013-08-27 15:14       ` Jan Krupa
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Krupa @ 2013-08-27 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Jan Krupa, anthony

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.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
---
 ui/keymaps.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/ui/keymaps.c b/ui/keymaps.c
index f373cc5..426a893 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -33,6 +33,9 @@ static int get_keysym(const name2keysym_t *table,
         if (!strcmp(p->name, name))
             return p->keysym;
     }
+    if (strlen(name) == 5 && name[0] == 'U') {
+        return (int)strtol(name + 1, NULL, 16);
+    }
     return 0;
 }
 
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Qemu-trivial] [PATCH 2/3] qemu-char: add Czech keymap file
  2013-08-27 15:14     ` [Qemu-devel] " Jan Krupa
@ 2013-09-01 15:19       ` Michael Tokarev
  -1 siblings, 0 replies; 12+ messages in thread
From: Michael Tokarev @ 2013-09-01 15:19 UTC (permalink / raw)
  To: Jan Krupa; +Cc: qemu-trivial, qemu-devel, anthony

27.08.2013 19:14, Jan Krupa wrote:
> This patch adds Czech keyboard layout to available keymap files.
>
> Signed-off-by: Jan Krupa <jkrupa@suse.com>
> ---
>   pc-bios/keymaps/cz |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>   1 files changed, 94 insertions(+), 0 deletions(-)
>   create mode 100644 pc-bios/keymaps/cz

This file is useles without a corresponding change to Makefile
(search for KEYMAPS= there).  Please add it there as well (either
in a separate patch or include it into this one).

Speaking of the keymap itself, and of the chars added in patch1,
I for one can't verify these, so I take it as granted.  After
all, this appears to be first attempt to implement cz keymap
in all these years...

Thanks,

/mjt


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH 2/3] qemu-char: add Czech keymap file
@ 2013-09-01 15:19       ` Michael Tokarev
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Tokarev @ 2013-09-01 15:19 UTC (permalink / raw)
  To: Jan Krupa; +Cc: qemu-trivial, qemu-devel, anthony

27.08.2013 19:14, Jan Krupa wrote:
> This patch adds Czech keyboard layout to available keymap files.
>
> Signed-off-by: Jan Krupa <jkrupa@suse.com>
> ---
>   pc-bios/keymaps/cz |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>   1 files changed, 94 insertions(+), 0 deletions(-)
>   create mode 100644 pc-bios/keymaps/cz

This file is useles without a corresponding change to Makefile
(search for KEYMAPS= there).  Please add it there as well (either
in a separate patch or include it into this one).

Speaking of the keymap itself, and of the chars added in patch1,
I for one can't verify these, so I take it as granted.  After
all, this appears to be first attempt to implement cz keymap
in all these years...

Thanks,

/mjt

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-trivial] [PATCH 3/3] qemu-char: add support for U-prefixed symbols
  2013-08-27 15:14       ` [Qemu-devel] " Jan Krupa
@ 2013-09-01 15:23         ` Michael Tokarev
  -1 siblings, 0 replies; 12+ messages in thread
From: Michael Tokarev @ 2013-09-01 15:23 UTC (permalink / raw)
  To: Jan Krupa; +Cc: qemu-trivial, qemu-devel, anthony

27.08.2013 19:14, Jan Krupa wrote:
> 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.
>
> Signed-off-by: Jan Krupa <jkrupa@suse.com>
> ---
>   ui/keymaps.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/ui/keymaps.c b/ui/keymaps.c
> index f373cc5..426a893 100644
> --- a/ui/keymaps.c
> +++ b/ui/keymaps.c
> @@ -33,6 +33,9 @@ static int get_keysym(const name2keysym_t *table,
>           if (!strcmp(p->name, name))
>               return p->keysym;
>       }
> +    if (strlen(name) == 5 && name[0] == 'U') {
> +        return (int)strtol(name + 1, NULL, 16);
> +    }

How about something like

   if (sscanf(name, "U%04x", &temp) == 1)

instead, to ensure it actually is a valid hex number?
Because this code will behave in interesting way
given, eg, "U" or "UU"... ;)  But I don't think this
really matters much...

Thanks,


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [Qemu-trivial] [PATCH 3/3] qemu-char: add support for U-prefixed symbols
@ 2013-09-01 15:23         ` Michael Tokarev
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Tokarev @ 2013-09-01 15:23 UTC (permalink / raw)
  To: Jan Krupa; +Cc: qemu-trivial, qemu-devel, anthony

27.08.2013 19:14, Jan Krupa wrote:
> 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.
>
> Signed-off-by: Jan Krupa <jkrupa@suse.com>
> ---
>   ui/keymaps.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/ui/keymaps.c b/ui/keymaps.c
> index f373cc5..426a893 100644
> --- a/ui/keymaps.c
> +++ b/ui/keymaps.c
> @@ -33,6 +33,9 @@ static int get_keysym(const name2keysym_t *table,
>           if (!strcmp(p->name, name))
>               return p->keysym;
>       }
> +    if (strlen(name) == 5 && name[0] == 'U') {
> +        return (int)strtol(name + 1, NULL, 16);
> +    }

How about something like

   if (sscanf(name, "U%04x", &temp) == 1)

instead, to ensure it actually is a valid hex number?
Because this code will behave in interesting way
given, eg, "U" or "UU"... ;)  But I don't think this
really matters much...

Thanks,

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-09-01 15:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-27 15:14 [Qemu-trivial] [PATCH 0/3] qemu-char: keymap changes for Czech and Unicode support Jan Krupa
2013-08-27 15:14 ` [Qemu-devel] " Jan Krupa
2013-08-27 15:14 ` [Qemu-trivial] [PATCH 1/3] qemu-char: add Czech characters to VNC keysyms Jan Krupa
2013-08-27 15:14   ` [Qemu-devel] " Jan Krupa
2013-08-27 15:14   ` [Qemu-trivial] [PATCH 2/3] qemu-char: add Czech keymap file Jan Krupa
2013-08-27 15:14     ` [Qemu-devel] " Jan Krupa
2013-08-27 15:14     ` [Qemu-trivial] [PATCH 3/3] qemu-char: add support for U-prefixed symbols Jan Krupa
2013-08-27 15:14       ` [Qemu-devel] " Jan Krupa
2013-09-01 15:23       ` [Qemu-trivial] " Michael Tokarev
2013-09-01 15:23         ` [Qemu-devel] " Michael Tokarev
2013-09-01 15:19     ` [Qemu-trivial] [PATCH 2/3] qemu-char: add Czech keymap file Michael Tokarev
2013-09-01 15:19       ` [Qemu-devel] " Michael Tokarev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.