keycodemapdb.git
5 years agoAdd ability to generate enums
Daniel P. Berrange [Mon, 31 Jul 2017 10:47:39 +0000 (11:47 +0100)] 
Add ability to generate enums

While we know the integer values corresponding to most key sets, the
QEMU QKeyCode values are explicitly not-public, not guaranteed stable.
We must therefore be able to emit symbolic enum constants, instead of
raw int values.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoAdd named constants for QKeyCode values
Daniel P. Berrange [Mon, 7 Aug 2017 09:52:46 +0000 (10:52 +0100)] 
Add named constants for QKeyCode values

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoUse STL types for C++ output
Pierre Ossman [Mon, 17 Jul 2017 10:00:43 +0000 (12:00 +0200)] 
Use STL types for C++ output

This give us much nicer lookup for string keys, boundary checks
and better introspection when it comes to iteration.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoProvide array size constant for C output
Pierre Ossman [Thu, 13 Jul 2017 14:04:41 +0000 (16:04 +0200)] 
Provide array size constant for C output

The array might not be in the same unit as the code using it, so
we need a way of indicating the number of entries.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoAdd support for JavaScript output
Pierre Ossman [Wed, 31 May 2017 14:02:36 +0000 (16:02 +0200)] 
Add support for JavaScript output

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoHandle string based codes
Pierre Ossman [Wed, 31 May 2017 13:51:59 +0000 (15:51 +0200)] 
Handle string based codes

Some systems use string identifiers rather than integers.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoFix some keys on macOS
Pierre Ossman [Thu, 13 Jul 2017 14:02:35 +0000 (16:02 +0200)] 
Fix some keys on macOS

The right command key was missing and the menu key was mis-assigned.

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoAdd mapping for XKEYBOARD key names
Pierre Ossman [Wed, 10 May 2017 14:55:28 +0000 (16:55 +0200)] 
Add mapping for XKEYBOARD key names

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoAdd mapping for HTML key codes
Pierre Ossman [Tue, 9 May 2017 14:12:58 +0000 (16:12 +0200)] 
Add mapping for HTML key codes

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoAdd tests for name-table
Pierre Ossman [Fri, 14 Jul 2017 12:22:43 +0000 (14:22 +0200)] 
Add tests for name-table

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoAdd tests for name-map
Pierre Ossman [Fri, 14 Jul 2017 12:16:27 +0000 (14:16 +0200)] 
Add tests for name-map

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoAdd tests for code-table
Pierre Ossman [Fri, 14 Jul 2017 12:10:38 +0000 (14:10 +0200)] 
Add tests for code-table

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoAdd basic tests
Pierre Ossman [Fri, 14 Jul 2017 09:13:03 +0000 (11:13 +0200)] 
Add basic tests

Signed-off-by: Pierre Ossman <ossman@cendio.se>
5 years agoAdd README for data columns
Pierre Ossman [Mon, 8 May 2017 14:55:33 +0000 (16:55 +0200)] 
Add README for data columns

5 years agoRename X11 keycode header to keysym
Pierre Ossman [Mon, 8 May 2017 14:54:48 +0000 (16:54 +0200)] 
Rename X11 keycode header to keysym

keycode means something else in X11, so let's adjust this header to
avoid confusion.

5 years agoFix AT set 2 table
Pierre Ossman [Mon, 8 May 2017 13:35:37 +0000 (15:35 +0200)] 
Fix AT set 2 table

There were a lot of errors for the extended codes. Re-generate
the entries based on the mapping Linux uses.

5 years agoMerge XT columns
Pierre Ossman [Mon, 8 May 2017 11:26:13 +0000 (13:26 +0200)] 
Merge XT columns

XT, Linux RAW and and AT set 1 are all really the same thing so merge
them all together. Linux RAW uses a different encoding, but we can
compute that as needed.

5 years agoCorrect lookup of name in comment
Pierre Ossman [Mon, 8 May 2017 13:27:00 +0000 (15:27 +0200)] 
Correct lookup of name in comment

The maps are indexed by Linux keycode, not by the keycode type
corresponding to the names.

5 years agokeymap-gen: add support for generating output for C++ 2/head
Peter Korsgaard [Tue, 23 May 2017 07:58:16 +0000 (09:58 +0200)] 
keymap-gen: add support for generating output for C++

Designated initializers ([index] = value,) are not available in C++:

https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

So add a custom stdc++ output format which outputs all array entries instead
of the "sparse" C variant.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
5 years agoFix message when seeing unknown map
Daniel P. Berrange [Wed, 26 Apr 2017 10:38:30 +0000 (11:38 +0100)] 
Fix message when seeing unknown map

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoFix incompatibility with older argparse
Daniel P. Berrange [Wed, 26 Apr 2017 10:34:15 +0000 (11:34 +0100)] 
Fix incompatibility with older argparse

With older argparse (circa 2.7.4 vintage), using set_defaults
to set a function on the main parser prevents it from ever
calling the functions set on the sub-parser.

We registered this default function so that we could get help
usage with argparse on python 3.x, since it doesn't print
error by default if no sub-parser command is given (but 2.x
does).

To workaround this, we instead check for 'func' attribute
existing on the parsed args. This is a no-op for python 2.x
since it already printed a usage message by default.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoMerge branch 'master' into 'master'
Pavel Grunt [Thu, 9 Mar 2017 10:47:51 +0000 (10:47 +0000)] 
Merge branch 'master' into 'master'

keymap-gen: Import sys

See merge request !1

5 years agokeymap-gen: Import sys 1/head
Pavel Grunt [Wed, 8 Mar 2017 13:22:11 +0000 (14:22 +0100)] 
keymap-gen: Import sys

It is used in usage()

5 years agoAdd ability to generate Perl POD docs for key map names & values
Daniel P. Berrange [Fri, 3 Mar 2017 12:21:24 +0000 (12:21 +0000)] 
Add ability to generate Perl POD docs for key map names & values

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoFix xorg kbd mapping generator
Daniel P. Berrange [Wed, 15 Feb 2017 18:45:05 +0000 (18:45 +0000)] 
Fix xorg kbd mapping generator

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoPrint help message if no sub-command is given
Daniel P. Berrange [Wed, 15 Feb 2017 18:14:26 +0000 (18:14 +0000)] 
Print help message if no sub-command is given

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoUse print_function in python 2
Daniel P. Berrange [Wed, 15 Feb 2017 18:13:51 +0000 (18:13 +0000)] 
Use print_function in python 2

To allow portability with py3 use the print_function. This
requires python >= 2.6.0

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoDon't call next() method in CSV reader
Daniel P. Berrange [Wed, 15 Feb 2017 18:13:06 +0000 (18:13 +0000)] 
Don't call next() method in CSV reader

The next() method was renamed in python3. Simply avoid calling
it to ensure portability

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoUse correct generator class for glib2
Daniel P. Berrange [Wed, 15 Feb 2017 14:57:24 +0000 (14:57 +0000)] 
Use correct generator class for glib2

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoUse guint16 / unsigned short for C data types
Daniel P. Berrange [Wed, 15 Feb 2017 14:53:17 +0000 (14:53 +0000)] 
Use guint16 / unsigned short for C data types

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoAdd missing X11 map field
Daniel P. Berrange [Wed, 15 Feb 2017 14:35:41 +0000 (14:35 +0000)] 
Add missing X11 map field

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
5 years agoInitial import of code
Daniel P. Berrange [Wed, 15 Feb 2017 14:19:28 +0000 (14:19 +0000)] 
Initial import of code

The data/keymaps.csv file is taken from the latest SPICE-GTK
repository. All contributions from this original file in both
SPICE-GTK and GTK-VNC repos were made under Red Hat copyright.
Red Hat grants permission to relicense to dual GPL2 or 3-clause
BSD.

The data/keymap-gen tool is a brand new file.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>