• Daniel P. Berrange's avatar
    Rewrite keymap code to work on more platforms · e0910397
    Daniel P. Berrange authored
    The current keymap code assumes an Xorg server on Linux with
    either evdev or kbd drivers. This adds heuristics to detect
    XQuartz (Xorg on OS-X) and XWin (Xorg on Cygwin). Further it
    adds support for native GDK on OS-X and Win32.
    
    It is not possible to assume that keycodes < 87 have a 1-1
    mapping to RFB (XT) keycodes. Thus the keymap arrays must
    have a complete dataset, all special casing is removed.
    
    All master  keymaps are defined in a CSV file. THis covers
    Linux keycodes, OSX keycodes, AT set1, 2 & 3, XT keycodes,
    the XT encoding used by the Linux KBD driver, USB keycodes,
    Win32 keycodes, the XT encoding used by Xorg on Cygwin,
    the XT encoding used by Xorg on Linux with kbd driver.
    
    Further RFB and final Xorg driver mappings are derived
    from these master maps automatically. The keymap-gen.pl
    tool can generate lookup tables between all possible
    keycode sets as required.
    
    eg To generate a map from native Win32 keycodes to RFB
    keycodes
    
       keymap-gen.pl keymaps.csv win32 rfb
    
    * gtk-vnc.spec.in, mingw32-gtk-vnc.spec.in: Require Text::CSV
      for generating keymaps
    * src/Makefile.am: Generate keymaps dynamically
    * src/keymap-gen.pl: Tool to generate keymaps from CSV file
    * src/keymaps.csv: Master keymap definitions
    * src/vncconnection.c: Improve keypress log message
    * src/vncdisplay.c: Convert to guint16 for keymap table
    * src/vncdisplaykeymap.c, src/vncdisplaykeymap.h: Use a
      new dynamically generated, full keymap.
    e0910397
keymap-gen.pl 4.42 KB