[at-spi2-core: 1/2] keysymtab: Add (re)generation script
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core: 1/2] keysymtab: Add (re)generation script
- Date: Sat, 11 Jul 2020 14:46:14 +0000 (UTC)
commit 98e239ffbf1e541aabafdda5bdf86662c4183f94
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date: Tue Jul 7 14:01:49 2020 +0200
keysymtab: Add (re)generation script
It does not produce exactly the same content yet, as the
left/rightanglebracket unicode equivalent was not defined in xterm as
what Xorg currently says.
registryd/ucs2keysym.c | 7 +++++--
registryd/ucs2keysym.sh | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 2 deletions(-)
---
diff --git a/registryd/ucs2keysym.c b/registryd/ucs2keysym.c
index a077ce0..09f5fd3 100644
--- a/registryd/ucs2keysym.c
+++ b/registryd/ucs2keysym.c
@@ -34,6 +34,9 @@
#include <X11/X.h>
#include "deviceeventcontroller.h" /* for prototype */
+/* DO NOT UPATE BY HAND!
+ * This table can be regenerated from Xorg's keysymdef.h with the ucs2keysym.sh
+ * script. */
struct codepair {
unsigned short keysym;
unsigned short ucs;
@@ -603,8 +606,8 @@ struct codepair {
{ 0x0afa, 0x2315 }, /* telephonerecorder ⌕ TELEPHONE RECORDER */
{ 0x08a4, 0x2320 }, /* topintegral ⌠ TOP HALF INTEGRAL */
{ 0x08a5, 0x2321 }, /* botintegral ⌡ BOTTOM HALF INTEGRAL */
- { 0x0abc, 0x2329 }, /* leftanglebracket 〈 LEFT-POINTING ANGLE BRACKET */
- { 0x0abe, 0x232a }, /* rightanglebracket 〉 RIGHT-POINTING ANGLE BRACKET */
+ { 0x0abc, 0x2329 }, /* leftanglebracket 〈 LEFT-POINTING ANGLE BRACKET, not U+27E8 per xterm
source */
+ { 0x0abe, 0x232a }, /* rightanglebracket 〉 RIGHT-POINTING ANGLE BRACKET, not U+27E9 per xterm
source */
{ 0x0bcc, 0x2395 }, /* quad ⎕ APL FUNCTIONAL SYMBOL QUAD */
{ 0x08ab, 0x239b }, /* topleftparens ⎛ LEFT PARENTHESIS UPPER HOOK */
{ 0x08ac, 0x239d }, /* botleftparens ⎝ LEFT PARENTHESIS LOWER HOOK */
diff --git a/registryd/ucs2keysym.sh b/registryd/ucs2keysym.sh
new file mode 100755
index 0000000..ff37f53
--- /dev/null
+++ b/registryd/ucs2keysym.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+if [ "$#" = 0 ]
+then
+ echo "Usage: $0 /path/to/keysymdef.h"
+ exit 1
+fi
+
+# We are only interested in
+# - keysyms which have well-defined unicode equivalent
+# - and are not just trivial unicode keysyms
+# - non-latin1 keysyms
+# - not the lamda aliases
+# and we tinker with the alias parentheses to make sorting easier
+
+grep '^#define' "$1" | \
+ grep -i "U+" | \
+ grep -vi "0x100[0-9a-f][0-9a-f][0-9a-f][0-9a-f]" | \
+ grep -vi " 0x00[0-9a-f][0-9a-f] " | \
+ grep -vi "_lamda " | \
+ sed -e 's/\/\*(/& /' | \
+ sed -e 's/)\*\// &/' | \
+ sort -k 5 | \
+ perl -CS -e '
+my $last = 0;
+while (<>) {
+ chomp;
+ if ( /^\#define XK_([a-zA-Z_0-9]+)(\s*) 0x([0-9a-f]+)\s*\/\*(\(?) U\+([0-9A-F]{4,6}) (.*)
\)?\*\/\s*$/ ) {
+ my ( $xk, $space, $keysym, $paren, $unicode, $unistr ) = ( $1, $2, $3, $4, $5, $6);
+ $unicode = hex("0x".$unicode);
+
+ print "\n" if (int($unicode / 256) != int($last / 256));
+ $last = $unicode;
+
+ printf " { 0x$keysym, 0x%04x }, /* $space$xk %lc $unistr */\n", $unicode, $unicode;
+ }
+}
+ '
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]