padarom / guacamole-common-js

:avocado: The JavaScript Guacamole client library modified for easy installation and usage via npm
http://guac-dev.org/
Apache License 2.0
41 stars 19 forks source link

The Guacamole.Keyboard only use Guacamole.Keyboard(document),but use in Guacamole.Keyboard(selfElement). #18

Closed recolzhao closed 2 years ago

recolzhao commented 2 years ago

Guacamole.Keyboard(document) will cover global window ,event of window can't use it. Event of Guacamole.Keyboard(selfElement) is invalid ,keyup and keydown can't trigger. Keybord.reset() is also invalid.

var keyboard = new Guacamole.Keyboard(document); // events can use ,but cover global window object.
var keyboard = new Guacamole.Keyboard(document.getElementById('terminal')); // events can't use.
recolzhao commented 2 years ago

document.keyup=null and document.keydown=null is solve this problem.