]> git.proxmox.com Git - mirror_novnc.git/blobdiff - core/rfb.js
Simplify keyboard event API
[mirror_novnc.git] / core / rfb.js
index 7f55123cce1b461ee65daef8cdae4620310cdb53..46b3158ebd6b3ad6e1ecf8f842ba59ff246db13a 100644 (file)
@@ -200,7 +200,7 @@ export default function RFB(defaults) {
     }
 
     this._keyboard = new Keyboard({target: this._focusContainer,
-                                   onKeyPress: this._handleKeyPress.bind(this)});
+                                   onKeyEvent: this._handleKeyEvent.bind(this)});
 
     this._mouse = new Mouse({target: this._target,
                              onMouseButton: this._handleMouseButton.bind(this),
@@ -664,9 +664,8 @@ RFB.prototype = {
         }
     },
 
-    _handleKeyPress: function (keyevent) {
-        var down = (keyevent.type == 'keydown');
-        this.sendKey(keyevent.keysym, keyevent.code, down);
+    _handleKeyEvent: function (keysym, code, down) {
+        this.sendKey(keysym, code, down);
     },
 
     _handleMouseButton: function (x, y, down, bmask) {