From d1190ba88adc418414a9f613ad6292759dbf5a3f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 14 May 2014 11:56:37 -0700 Subject: [PATCH] GUAC-685: Track text composition. Do not handle input events during composition. --- .../src/main/webapp/scripts/client-ui.js | 55 +++++++++++++++---- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/guacamole/src/main/webapp/scripts/client-ui.js b/guacamole/src/main/webapp/scripts/client-ui.js index 21a60089d..3bc5da721 100644 --- a/guacamole/src/main/webapp/scripts/client-ui.js +++ b/guacamole/src/main/webapp/scripts/client-ui.js @@ -1891,6 +1891,12 @@ GuacUI.Client.attach = function(guac) { } + /** + * Presses and releases the key corresponding to the given keysym, as if + * typed by the user. + * + * @param {Number} keysym The keysym of the key to send. + */ function send_keysym(keysym) { var guac = GuacUI.Client.attachedClient; @@ -1902,6 +1908,12 @@ GuacUI.Client.attach = function(guac) { } + /** + * Presses and releases the key having the keysym corresponding to the + * Unicode codepoint given, as if typed by the user. + * + * @param {Number} codepoint The Unicode codepoint of the key to send. + */ function send_codepoint(codepoint) { if (codepoint === 10) { @@ -1915,6 +1927,22 @@ GuacUI.Client.attach = function(guac) { } + /** + * Translates each character within the given string to keysyms and sends + * each, in order, as if typed by the user. + * + * @param {String} content The string to send. + */ + function send_string(content) { + + for (var i=0; i