From: Michael Jumper Date: Wed, 21 Mar 2012 02:43:40 +0000 (-0700) Subject: Add per-client keysym state mapping. X-Git-Url: http://git.alex.org.uk Add per-client keysym state mapping. --- diff --git a/include/client.h b/include/client.h index e56dbb6..1a13fee 100644 --- a/include/client.h +++ b/include/client.h @@ -67,6 +67,8 @@ typedef struct rdp_guac_client_data { const guac_rdp_keysym_scancode_map* keysym_scancodes; + guac_rdp_keysym_state_map keysym_state; + } rdp_guac_client_data; typedef struct rdp_freerdp_context { diff --git a/include/rdp_keymap.h b/include/rdp_keymap.h index 1970889..39c9be4 100644 --- a/include/rdp_keymap.h +++ b/include/rdp_keymap.h @@ -84,6 +84,11 @@ typedef struct guac_rdp_altcode_map { } guac_rdp_altcode_map; /** + * Mapping from keysym to current state + */ +typedef int guac_rdp_keysym_state_map[256][256]; + +/** * Static mapping from keysyms to scancodes. */ typedef guac_rdp_scancode_map guac_rdp_keysym_scancode_map[256][256]; diff --git a/src/client.c b/src/client.c index dc6a081..365bfa4 100644 --- a/src/client.c +++ b/src/client.c @@ -325,6 +325,9 @@ int guac_client_init(guac_client* client, int argc, char** argv) { guac_client_data->current_surface = GUAC_DEFAULT_LAYER; guac_client_data->keysym_scancodes = &guac_rdp_keysym_scancode_en_us; + /* Clear keysym state mapping */ + memset(guac_client_data->keysym_state, 0, sizeof(guac_rdp_keysym_state_map)); + ((rdp_freerdp_context*) rdp_inst->context)->client = client; client->data = guac_client_data;