VirtualBox

Changeset 40392 in vbox


Ignore:
Timestamp:
Mar 7, 2012 2:16:40 PM (13 years ago)
Author:
vboxsync
Message:

Devices/keyboards: try to better support Sun function keys, take 2.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/UsbKbd.cpp

    r40326 r40392  
    364364
    365365/** Lookup table for converting PC/XT scan codes to USB HID usage codes. */
     366/** We map the scan codes for F13 to F23 to the usage codes for Sun keyboard
     367 *  left-hand side function keys rather than to the standard F13 to F23 usage
     368 *  codes, since we suspect that there are more people wanting Sun keyboard
     369 *  emulation than emulation of other keyboards with extended function keys. */
    366370static uint8_t aScancode2Hid[] =
    367371{
     
    378382    0x5a, 0x5b, 0x62, 0x63, 0x00, 0x00, 0x64, 0x44, /* 50-57 */
    379383    0x45, 0x67, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, /* 58-5F */
    380     0x00, 0x00, 0x00, 0x00, 0x68, 0x69, 0x6a, 0x6b, /* 60-67 */
    381     0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x00, /* 68-6F */
     384               /* Sun keys: Props Undo  Front Copy */
     385    0x00, 0x00, 0x00, 0x00, 0x76, 0x7a, 0x77, 0x7c, /* 60-67 */
     386 /* Open  Paste Find  Cut   Stop  Again Help */
     387    0x74, 0x7d, 0x7e, 0x7b, 0x78, 0x79, 0x75, 0x00, /* 68-6F */
    382388    0x88, 0x91, 0x90, 0x87, 0x00, 0x00, 0x00, 0x00, /* 70-77 */
    383389    0x00, 0x8a, 0x00, 0x8b, 0x00, 0x89, 0x85, 0x00  /* 78-7F */
     
    394400    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 28-2F */
    395401    0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x46, /* 30-37 */
    396                    /* Sun-specific keys.  The type 1 codes are made up */
    397     0xe6, 0x00, 0x00, 0x75, 0x76, 0x77, 0x00, 0x00, /* 38-3F */
     402    0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 38-3F */
    398403    0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x4a, /* 40-47 */
    399404    0x52, 0x4b, 0x00, 0x50, 0x00, 0x4f, 0x00, 0x4d, /* 48-4F */
  • trunk/src/VBox/Frontends/Common/VBoxKeyboard/keyboard-tables.h

    r40326 r40392  
    6969};
    7070
     71/** @note On the whole we use Microsoft's "USB HID to PS/2 Scan Code
     72 *    Translation Table" and
     73 *      http://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html
     74 *    as a reference for scan code numbers.
     75 *    Sun keyboards have eleven additional keys on the left-hand side.
     76 *    These keys never had PC scan codes assigned to them.  We map all X11
     77 *    keycodes which can correspond to these keys to the PC scan codes for
     78 *    F13 to F23 (as per Microsoft's translation table) and the USB keyboard
     79 *    code translates them back to the correct usage codes. */
     80
    7181/* Scan code table for non-character keys */
    72 
    7382static const unsigned nonchar_key_scan[256] =
    7483{
     
    97106    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* FF58 */
    98107    /* misc keys */
    99                                                 /* Menu */
    100 #ifdef sun
    101     /*?*/ 0, 0x137, 0x7b, 0x152, 0x00, 0x00, 0x00, 0x15D,        /* FF60 */
    102 #else
    103     /*?*/ 0, 0x137, 0, 0x152, 0x00, 0x00, 0x00,    0x15D,        /* FF60 */
    104 #endif /* sun */
    105              /* Help (invented scan code) */
    106     0x00, 0x00, 0x13B, 0x146, 0x00, 0x00, 0x00, 0x00,            /* FF68 */
     108          /* Print Open  Insert       Undo  Again Menu */
     109                /* ->F17              ->F14 ->F22 */
     110    0x00, 0x137,   0x68, 0x152, 0x00, 0x65, 0x6d, 0x15D,         /* FF60 */
     111 /* Find  Stop  Help  Break */
     112 /* ->F19 ->F21 ->F23 */
     113    0x6a, 0x6c, 0x6e, 0x146, 0x00, 0x00, 0x00, 0x00,             /* FF68 */
    107114    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* FF70 */
    108115    /* keypad keys */
     
    120127    0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44,              /* FFC0 */
    121128#ifdef sun
    122     /* On Solaris for historical reasons the STOP and AGAIN keys are reported
    123      * as F11 and F12 respectively.  We send invented type 1 scan codes for
    124      * which can be translated to real ones again by the USB keyboard
    125      * emulation. */
    126     0x13C, 0x13D, 0x64,  0x65,  0x66,  0x67,  0x68,  0x69,       /* FFC8 */
    127     0x6a,  0x6b,  0x6c,  0x6d,  0x6e,  0x76,  0x00,  0x00,       /* FFD0 */
     129 /* Stop  Again F13   F14   F15   F16   F17   F18 */
     130 /* ->F21 ->F22 */
     131    0x6c, 0x6d, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,              /* FFC8 */
    128132#else
    129     0x57,  0x58,  0x64,  0x65,  0x66,  0x67,  0x68,  0x69,       /* FFC8 */
    130     0x6a,  0x6b,  0x6c,  0x6d,  0x6e,  0x76,  0x00,  0x00,       /* FFD0 */
     133 /* F11    F12 */
     134    0x57,  0x58,  0x64, 0x65, 0x66, 0x67, 0x68, 0x69,            /* FFC8 */
    131135#endif
     136 /* F19   F20   F21   F22   F23   F24 */
     137    0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x76, 0x00, 0x00,              /* FFD0 */
    132138    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,              /* FFD8 */
    133139    /* modifier keys */
     
    139145
    140146/* This list was put together using /usr/include/X11/XF86keysym.h and
    141    http://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html.  It has not yet
     147   the documents referenced above for scan code numbers.  It has not yet
    142148   been extensively tested.  The scancodes are those used by MicroSoft
    143149   keyboards. */
     
    160166    0, 0, 0, 0, 0, 0, 0, 0,                                     /* 1008FF48 */
    161167 /* AppL   AppR         Calc      Close  Copy */
    162     0x109, 0x11e, 0, 0, 0x121, 0, 0x140, 0x118,                 /* 1008FF50 */
    163  /* Cut          Docmnts Excel */
    164     0x117, 0, 0, 0x105, 0x114, 0, 0, 0,                         /* 1008FF58 */
     168                                      /* ->F16 */
     169    0x109, 0x11e, 0, 0, 0x121, 0, 0x140, 0x67,                  /* 1008FF50 */
     170 /* Cut         Docmnts Excel */
     171 /* ->F20 */
     172    0x6b, 0, 0, 0x105, 0x114, 0, 0, 0,                         /* 1008FF58 */
    165173 /*    LogOff */
    166174    0, 0x116, 0, 0, 0, 0, 0, 0,                                 /* 1008FF60 */
    167  /*       OffcHm Open      Paste */
    168     0, 0, 0x13c, 0x13f, 0, 0x10a, 0, 0,                         /* 1008FF68 */
     175 /*       OffcHm Open     Paste */
     176              /* ->F17    ->F18 */
     177    0, 0, 0x13c, 0x68, 0, 0x69, 0, 0,                           /* 1008FF68 */
    169178 /*       Reply  Refresh         Save */
    170179    0, 0, 0x141, 0x167, 0, 0, 0, 0x157,                         /* 1008FF70 */
     
    213222    0,     0, 0, 0, 0, 0, 0, 0,                                 /* 1005FF60 */
    214223    0, 0, 0, 0, 0, 0, 0, 0,                                     /* 1005FF68 */
    215  /* Props  Front  Copy   Paste Cut    Power  Vol-   Mute */
    216     0x106, 0x10c, 0x178, 0x65, 0x13c, 0x15e, 0x12e, 0x120,      /* 1005FF70 */
     224 /* Props Front Copy  Paste Cut    Power  Vol-   Mute */
     225 /* ->F13 ->F15 ->F16 ->F18 ->F20 */
     226    0x64, 0x66, 0x67, 0x69, 0x6b,  0x15e, 0x12e, 0x120,         /* 1005FF70 */
    217227 /* Vol+ */
    218228    0x130, 0, 0, 0, 0, 0, 0, 0,                                 /* 1005FF78 */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette