From 592dbec345451f061b9f939bb28e9ce86bcfadc3 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 16 May 2012 01:33:34 -0700 Subject: [PATCH] Remove now unused altcode function. --- include/rdp_keymap.h | 3 ++- src/guac_handlers.c | 43 ------------------------------------------- 2 files changed, 2 insertions(+), 44 deletions(-) diff --git a/include/rdp_keymap.h b/include/rdp_keymap.h index 8de2de5..05b0b01 100644 --- a/include/rdp_keymap.h +++ b/include/rdp_keymap.h @@ -132,7 +132,8 @@ extern const guac_rdp_keymap guac_rdp_keymap_en_us; extern const guac_rdp_keymap guac_rdp_keymap_base; /** - * Simple macro for referencing the mapped value of an altcode or scancode for a given keysym. + * Simple macro for referencing the mapped value of a scancode for a given + * keysym. */ #define GUAC_RDP_KEYSYM_LOOKUP(keysym_mapping, keysym) ((keysym_mapping)[((keysym) & 0xFF00) >> 8][(keysym) & 0xFF]) diff --git a/src/guac_handlers.c b/src/guac_handlers.c index a712e56..4c1bf1f 100644 --- a/src/guac_handlers.c +++ b/src/guac_handlers.c @@ -65,7 +65,6 @@ void __guac_rdp_update_keysyms(guac_client* client, const int* keysym_string, int from, int to); int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed); -void __guac_rdp_send_altcode(guac_client* client, int altcode); int rdp_guac_client_free_handler(guac_client* client) { @@ -279,48 +278,6 @@ int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) { return 0; } -void __guac_rdp_send_altcode(guac_client* client, int altcode) { - - rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data; - freerdp* rdp_inst = guac_client_data->rdp_inst; - int i; - - /* Lookup scancode for Alt */ - int alt = GUAC_RDP_KEYSYM_LOOKUP( - guac_client_data->keymap, - 0xFFE9 /* Alt_L */).scancode; - - /* Release all pressed modifiers */ - __guac_rdp_update_keysyms(client, GUAC_KEYSYMS_ALL_MODIFIERS, 1, 0); - - /* Press Alt */ - rdp_inst->input->KeyboardEvent(rdp_inst->input, KBD_FLAGS_DOWN, alt); - - /* For each character in four-digit Alt-code ... */ - for (i=0; i<4; i++) { - - /* Get scancode of keypad digit */ - int scancode = GUAC_RDP_KEYSYM_LOOKUP( - guac_client_data->keymap, - 0xFFB0 + (altcode / 1000) - ).scancode; - - /* Press and release digit */ - rdp_inst->input->KeyboardEvent(rdp_inst->input, KBD_FLAGS_DOWN, scancode); - rdp_inst->input->KeyboardEvent(rdp_inst->input, KBD_FLAGS_RELEASE, scancode); - - /* Shift digits left by one place */ - altcode = (altcode * 10) % 10000; - - } - - /* Release Alt */ - rdp_inst->input->KeyboardEvent(rdp_inst->input, KBD_FLAGS_RELEASE, alt); - - /* Press all originally pressed modifiers */ - __guac_rdp_update_keysyms(client, GUAC_KEYSYMS_ALL_MODIFIERS, 1, 1); - -} int __guac_rdp_send_keysym(guac_client* client, int keysym, int pressed) { -- 1.7.10.4