Skip to content
Permalink
Browse files
Merge include Guacamole.InputSink and listenTo() in keyboard test if …
…available.
  • Loading branch information
necouchman committed Oct 3, 2018
2 parents 4a87ae4 + 8993355 commit 66eb08c22d47f4396a21f56ef9c5f04d11a7edea
Showing 1 changed file with 18 additions and 1 deletion.
@@ -27,7 +27,7 @@

<body>

<textarea></textarea>
<textarea id="field"></textarea>

<div id="log"></div>

@@ -38,6 +38,7 @@

<!-- Load required guacamole-common-js modules from git -->
<script type="text/javascript">
GIT_GUAC.loadModule('InputSink.js');
GIT_GUAC.loadModule('Keyboard.js');
GIT_GUAC.loadModule('Version.js');
</script>
@@ -57,6 +58,22 @@

var keyboard = new Guacamole.Keyboard(document);

// Listen to additional elements if version of API being
// tested defines listenTo()
if (keyboard.listenTo) {

keyboard.listenTo(document.getElementById('field'));

// Use Guacamole.InputSink if available in version of API
// being tested
if (Guacamole.InputSink) {
var sink = new Guacamole.InputSink();
document.body.appendChild(sink.getElement());
keyboard.listenTo(sink.getElement());
}

}

keyboard.onkeydown = function(keysym) {
log.log("guacamole", "keydown",
"0x" + keysym.toString(16), X11_KEYSYM[keysym]);

0 comments on commit 66eb08c

Please sign in to comment.