mike-jumper commented on code in PR #908:
URL: https://github.com/apache/guacamole-client/pull/908#discussion_r1310685970


##########
guacamole-common-js/src/main/webapp/modules/KeyEventInterpreter.js:
##########
@@ -424,6 +452,29 @@ Guacamole.KeyEventInterpreter = function 
KeyEventInterpreter(batchSeperation, st
                 var keyText;
                 var typed;
 
+                // If this key should be both printed and rendered
+                if (keyDefinition.value != null && 
keyDefinition.printAndRender) {
+
+                    // The printed name of the key
+                    var printedValue = getPrintedKeyName(keyDefinition);
+
+                    // The directly rendered value
+                    var renderedValue = keyDefinition.value;
+
+                    // Display the name first, followed by the value
+                    currentBatch.simpleValue += printedValue;
+                    currentBatch.simpleValue += renderedValue;
+
+                    // Add pair of key events in the same order, with the name
+                    // displayed as non-typed to ensure proper styling
+                    currentBatch.events.push(new 
Guacamole.KeyEventInterpreter.KeyEvent(
+                        printedValue, false, relativeTimestap));
+                    currentBatch.events.push(new 
Guacamole.KeyEventInterpreter.KeyEvent(
+                        renderedValue, true, relativeTimestap));

Review Comment:
   I don't think individual events should possibly be split into multiple 
events purely for the sake of rendering, as it's not guacamole-common-js that 
should dictate that rendering.
   
   I think we should instead settle on a structure that represents both the 
expected typed result (if any) of a logical event and the keys pressed to 
produce that result, leaving it up to the implementation to decide how that is 
ultimately rendered.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to