Add remaining modifier strings, fix unshifted en-us mappings.

This commit is contained in:
Michael Jumper 2012-03-21 23:45:37 -07:00
parent 6443ffc0c2
commit d3c8377c26
3 changed files with 118 additions and 47 deletions

View File

@ -128,11 +128,31 @@ extern const guac_rdp_keymap guac_rdp_keymap_base;
*/ */
extern const int GUAC_KEYSYMS_SHIFT[]; extern const int GUAC_KEYSYMS_SHIFT[];
/**
* Keysym string containing both "shift" keys.
*/
extern const int GUAC_KEYSYMS_ALL_SHIFT[];
/**
* Keysym string containing only the left "ctrl" key.
*/
extern const int GUAC_KEYSYMS_CTRL[];
/**
* Keysym string containing both "ctrl" keys.
*/
extern const int GUAC_KEYSYMS_ALL_CTRL[];
/** /**
* Keysym string containing only the left "alt" key. * Keysym string containing only the left "alt" key.
*/ */
extern const int GUAC_KEYSYMS_ALT[]; extern const int GUAC_KEYSYMS_ALT[];
/**
* Keysym string containing both "alt" keys.
*/
extern const int GUAC_KEYSYMS_ALL_ALT[];
/** /**
* Keysym string containing all modifier keys. * Keysym string containing all modifier keys.
*/ */

View File

@ -38,8 +38,13 @@
#include "rdp_keymap.h" #include "rdp_keymap.h"
const int GUAC_KEYSYMS_SHIFT[] = {0xFFE1, 0}; const int GUAC_KEYSYMS_SHIFT[] = {0xFFE1, 0};
const int GUAC_KEYSYMS_ALL_SHIFT[] = {0xFFE1, 0xFFE2, 0};
const int GUAC_KEYSYMS_CTRL[] = {0xFFE3, 0};
const int GUAC_KEYSYMS_ALL_CTRL[] = {0xFFE3, 0xFFE4, 0};
const int GUAC_KEYSYMS_ALT[] = {0xFFE9, 0}; const int GUAC_KEYSYMS_ALT[] = {0xFFE9, 0};
const int GUAC_KEYSYMS_ALL_ALT[] = {0xFFE9, 0xFFEA, 0};
const int GUAC_KEYSYMS_ALL_MODIFIERS[] = { const int GUAC_KEYSYMS_ALL_MODIFIERS[] = {
0xFFE1, 0xFFE2, /* Left and right shift */ 0xFFE1, 0xFFE2, /* Left and right shift */

View File

@ -89,60 +89,76 @@ static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
.set_keysyms = GUAC_KEYSYMS_SHIFT }, .set_keysyms = GUAC_KEYSYMS_SHIFT },
/* comma */ /* comma */
{ .keysym = 0x002c, .scancode = 0x33 }, { .keysym = 0x002c, .scancode = 0x33,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* minus */ /* minus */
{ .keysym = 0x002d, .scancode = 0x0C }, { .keysym = 0x002d, .scancode = 0x0C,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* period */ /* period */
{ .keysym = 0x002e, .scancode = 0x34 }, { .keysym = 0x002e, .scancode = 0x34,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* slash */ /* slash */
{ .keysym = 0x002f, .scancode = 0x35 }, { .keysym = 0x002f, .scancode = 0x35,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 0 */ /* 0 */
{ .keysym = 0x0030, .scancode = 0x0B }, { .keysym = 0x0030, .scancode = 0x0B,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 1 */ /* 1 */
{ .keysym = 0x0031, .scancode = 0x02 }, { .keysym = 0x0031, .scancode = 0x02,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 2 */ /* 2 */
{ .keysym = 0x0032, .scancode = 0x03 }, { .keysym = 0x0032, .scancode = 0x03,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 3 */ /* 3 */
{ .keysym = 0x0033, .scancode = 0x04 }, { .keysym = 0x0033, .scancode = 0x04,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 4 */ /* 4 */
{ .keysym = 0x0034, .scancode = 0x05 }, { .keysym = 0x0034, .scancode = 0x05,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 5 */ /* 5 */
{ .keysym = 0x0035, .scancode = 0x06 }, { .keysym = 0x0035, .scancode = 0x06,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 6 */ /* 6 */
{ .keysym = 0x0036, .scancode = 0x07 }, { .keysym = 0x0036, .scancode = 0x07,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 7 */ /* 7 */
{ .keysym = 0x0037, .scancode = 0x08 }, { .keysym = 0x0037, .scancode = 0x08,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 8 */ /* 8 */
{ .keysym = 0x0038, .scancode = 0x09 }, { .keysym = 0x0038, .scancode = 0x09,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* 9 */ /* 9 */
{ .keysym = 0x0039, .scancode = 0x0A }, { .keysym = 0x0039, .scancode = 0x0A,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* colon */ /* colon */
{ .keysym = 0x003a, .scancode = 0x27, { .keysym = 0x003a, .scancode = 0x27,
.set_keysyms = GUAC_KEYSYMS_SHIFT }, .set_keysyms = GUAC_KEYSYMS_SHIFT },
/* semicolon */ /* semicolon */
{ .keysym = 0x003b, .scancode = 0x27 }, { .keysym = 0x003b, .scancode = 0x27,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* less */ /* less */
{ .keysym = 0x003c, .scancode = 0x33, { .keysym = 0x003c, .scancode = 0x33,
.set_keysyms = GUAC_KEYSYMS_SHIFT }, .set_keysyms = GUAC_KEYSYMS_SHIFT },
/* equal */ /* equal */
{ .keysym = 0x003d, .scancode = 0x0D }, { .keysym = 0x003d, .scancode = 0x0D,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* greater */ /* greater */
{ .keysym = 0x003e, .scancode = 0x34, { .keysym = 0x003e, .scancode = 0x34,
@ -261,16 +277,19 @@ static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
.set_keysyms = GUAC_KEYSYMS_SHIFT }, .set_keysyms = GUAC_KEYSYMS_SHIFT },
/* bracketleft */ /* bracketleft */
{ .keysym = 0x005b, .scancode = 0x1A }, { .keysym = 0x005b, .scancode = 0x1A,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* backslash */ /* backslash */
{ .keysym = 0x005c, .scancode = 0x2B }, { .keysym = 0x005c, .scancode = 0x2B,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* bracketright */ /* bracketright */
{ .keysym = 0x005d, .scancode = 0x1B }, { .keysym = 0x005d, .scancode = 0x1B,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* asciicircum */ /* asciicircum */
{ .keysym = 0x005e, .scancode = 0x29, { .keysym = 0x005e, .scancode = 0x07,
.set_keysyms = GUAC_KEYSYMS_SHIFT }, .set_keysyms = GUAC_KEYSYMS_SHIFT },
/* underscore */ /* underscore */
@ -278,85 +297,112 @@ static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
.set_keysyms = GUAC_KEYSYMS_SHIFT }, .set_keysyms = GUAC_KEYSYMS_SHIFT },
/* quoteleft */ /* quoteleft */
{ .keysym = 0x0060, .scancode = 0x29 }, { .keysym = 0x0060, .scancode = 0x29,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* a */ /* a */
{ .keysym = 0x0061, .scancode = 0x1E }, { .keysym = 0x0061, .scancode = 0x1E,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* b */ /* b */
{ .keysym = 0x0062, .scancode = 0x30 }, { .keysym = 0x0062, .scancode = 0x30,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* c */ /* c */
{ .keysym = 0x0063, .scancode = 0x2E }, { .keysym = 0x0063, .scancode = 0x2E,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* d */ /* d */
{ .keysym = 0x0064, .scancode = 0x20 }, { .keysym = 0x0064, .scancode = 0x20,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* e */ /* e */
{ .keysym = 0x0065, .scancode = 0x12 }, { .keysym = 0x0065, .scancode = 0x12,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* f */ /* f */
{ .keysym = 0x0066, .scancode = 0x21 }, { .keysym = 0x0066, .scancode = 0x21,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* g */ /* g */
{ .keysym = 0x0067, .scancode = 0x22 }, { .keysym = 0x0067, .scancode = 0x22,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* h */ /* h */
{ .keysym = 0x0068, .scancode = 0x23 }, { .keysym = 0x0068, .scancode = 0x23,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* i */ /* i */
{ .keysym = 0x0069, .scancode = 0x17 }, { .keysym = 0x0069, .scancode = 0x17,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* j */ /* j */
{ .keysym = 0x006a, .scancode = 0x24 }, { .keysym = 0x006a, .scancode = 0x24,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* k */ /* k */
{ .keysym = 0x006b, .scancode = 0x25 }, { .keysym = 0x006b, .scancode = 0x25,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* l */ /* l */
{ .keysym = 0x006c, .scancode = 0x26 }, { .keysym = 0x006c, .scancode = 0x26,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* m */ /* m */
{ .keysym = 0x006d, .scancode = 0x32 }, { .keysym = 0x006d, .scancode = 0x32,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* n */ /* n */
{ .keysym = 0x006e, .scancode = 0x31 }, { .keysym = 0x006e, .scancode = 0x31,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* o */ /* o */
{ .keysym = 0x006f, .scancode = 0x18 }, { .keysym = 0x006f, .scancode = 0x18,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* p */ /* p */
{ .keysym = 0x0070, .scancode = 0x19 }, { .keysym = 0x0070, .scancode = 0x19,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* q */ /* q */
{ .keysym = 0x0071, .scancode = 0x10 }, { .keysym = 0x0071, .scancode = 0x10,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* r */ /* r */
{ .keysym = 0x0072, .scancode = 0x13 }, { .keysym = 0x0072, .scancode = 0x13,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* s */ /* s */
{ .keysym = 0x0073, .scancode = 0x1F }, { .keysym = 0x0073, .scancode = 0x1F,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* t */ /* t */
{ .keysym = 0x0074, .scancode = 0x14 }, { .keysym = 0x0074, .scancode = 0x14,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* u */ /* u */
{ .keysym = 0x0075, .scancode = 0x16 }, { .keysym = 0x0075, .scancode = 0x16,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* v */ /* v */
{ .keysym = 0x0076, .scancode = 0x2F }, { .keysym = 0x0076, .scancode = 0x2F,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* w */ /* w */
{ .keysym = 0x0077, .scancode = 0x11 }, { .keysym = 0x0077, .scancode = 0x11,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* x */ /* x */
{ .keysym = 0x0078, .scancode = 0x2D }, { .keysym = 0x0078, .scancode = 0x2D,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* y */ /* y */
{ .keysym = 0x0079, .scancode = 0x15 }, { .keysym = 0x0079, .scancode = 0x15,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* z */ /* z */
{ .keysym = 0x007a, .scancode = 0x2C }, { .keysym = 0x007a, .scancode = 0x2C,
.clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT },
/* braceleft */ /* braceleft */
{ .keysym = 0x007b, .scancode = 0x1A, { .keysym = 0x007b, .scancode = 0x1A,