]> git.proxmox.com Git - mirror_novnc.git/blobdiff - core/input/keyboard.js
Change some attributes to arguments
[mirror_novnc.git] / core / input / keyboard.js
index fa4a5ae4f0ff1c2ac3a6583dda89106edc02de44..6dee460f65148a08efef3a1efa3301633bf93caf 100644 (file)
@@ -18,14 +18,14 @@ import KeyTable from "./keysym.js";
 // Keyboard event handler
 //
 
-export default function Keyboard(defaults) {
+export default function Keyboard(target, defaults) {
+    this._target = target || null;
+
     this._keyDownList = {};         // List of depressed keys
                                     // (even if they are happy)
     this._pendingKey = null;        // Key waiting for keypress
 
-    set_defaults(this, defaults, {
-        'target': null,
-    });
+    set_defaults(this, defaults, {});
 
     // keep these here so we can refer to them later
     this._eventHandlers = {
@@ -338,7 +338,5 @@ Keyboard.prototype = {
 };
 
 make_properties(Keyboard, [
-    ['target',     'wo', 'dom'],  // DOM element that captures keyboard input
-
     ['onKeyEvent', 'rw', 'func'] // Handler for key press/release
 ]);