aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-08-07Add ability to generate enumsDaniel P. Berrange1-94/+143
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>
2017-08-07Add named constants for QKeyCode valuesDaniel P. Berrange2-529/+534
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-08-02Use STL types for C++ outputPierre Ossman3-27/+16
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>
2017-08-02Provide array size constant for C outputPierre Ossman3-8/+27
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>
2017-08-02Add support for JavaScript outputPierre Ossman4-1/+118
Signed-off-by: Pierre Ossman <ossman@cendio.se>
2017-08-02Handle string based codesPierre Ossman6-57/+212
Some systems use string identifiers rather than integers. Signed-off-by: Pierre Ossman <ossman@cendio.se>
2017-08-02Fix some keys on macOSPierre Ossman1-5/+5
The right command key was missing and the menu key was mis-assigned. Signed-off-by: Pierre Ossman <ossman@cendio.se>
2017-08-02Add mapping for XKEYBOARD key namesPierre Ossman3-513/+540
Signed-off-by: Pierre Ossman <ossman@cendio.se>
2017-08-02Add mapping for HTML key codesPierre Ossman3-511/+525
Signed-off-by: Pierre Ossman <ossman@cendio.se>
2017-08-02Add tests for name-tablePierre Ossman5-3/+17
Signed-off-by: Pierre Ossman <ossman@cendio.se>
2017-08-02Add tests for name-mapPierre Ossman5-3/+24
Signed-off-by: Pierre Ossman <ossman@cendio.se>
2017-08-02Add tests for code-tablePierre Ossman5-3/+17
Signed-off-by: Pierre Ossman <ossman@cendio.se>
2017-08-02Add basic testsPierre Ossman7-0/+87
Signed-off-by: Pierre Ossman <ossman@cendio.se>
2017-07-13Add README for data columnsPierre Ossman1-0/+74
2017-07-13Rename X11 keycode header to keysymPierre Ossman1-1/+1
keycode means something else in X11, so let's adjust this header to avoid confusion.
2017-07-13Fix AT set 2 tablePierre Ossman1-44/+44
There were a lot of errors for the extended codes. Re-generate the entries based on the mapping Linux uses.
2017-07-13Merge XT columnsPierre Ossman2-535/+539
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.
2017-07-13Correct lookup of name in commentPierre Ossman1-8/+8
The maps are indexed by Linux keycode, not by the keycode type corresponding to the names.
2017-05-23keymap-gen: add support for generating output for C++Peter Korsgaard1-0/+21
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>
2017-04-26Fix message when seeing unknown mapDaniel P. Berrange1-16/+16
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-04-26Fix incompatibility with older argparseDaniel P. Berrange1-3/+5
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>
2017-03-09Merge branch 'master' into 'master' Pavel Grunt1-0/+1
keymap-gen: Import sys See merge request !1
2017-03-08keymap-gen: Import sysPavel Grunt1-0/+1
It is used in usage()
2017-03-03Add ability to generate Perl POD docs for key map names & valuesDaniel P. Berrange1-14/+179
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-02-15Fix xorg kbd mapping generatorDaniel P. Berrange1-2/+2
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-02-15Print help message if no sub-command is givenDaniel P. Berrange1-0/+6
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-02-15Use print_function in python 2Daniel P. Berrange1-28/+31
To allow portability with py3 use the print_function. This requires python >= 2.6.0 Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-02-15Don't call next() method in CSV readerDaniel P. Berrange1-3/+7
The next() method was renamed in python3. Simply avoid calling it to ensure portability Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-02-15Use correct generator class for glib2Daniel P. Berrange1-1/+1
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-02-15Use guint16 / unsigned short for C data typesDaniel P. Berrange1-2/+2
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-02-15Add missing X11 map fieldDaniel P. Berrange1-0/+6
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-02-15Initial import of codeDaniel P. Berrange5-0/+1550
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>