return true;
}
- if (this._qemuExtKeyEventSupported) {
- var scancode = XtScancode[code];
-
- if (scancode === undefined) {
- Log.Error('Unable to find a xt scancode for code: ' + code);
- // FIXME: not in the spec, but this is what
- // gtk-vnc does
- scancode = 0;
- }
+ var scancode = XtScancode[code];
+ if (this._qemuExtKeyEventSupported && scancode) {
// 0 is NoSymbol
keysym = keysym || 0;
client.sendKey(0x20, 'Space', true);
expect(client._sock).to.have.sent(expected._sQ);
});
+
+ it('should not send QEMU extended events if unknown key code', function () {
+ client._qemuExtKeyEventSupported = true;
+ var expected = {_sQ: new Uint8Array(8), _sQlen: 0, flush: function () {}};
+ RFB.messages.keyEvent(expected, 123, 1);
+ client.sendKey(123, 'FooBar', true);
+ expect(client._sock).to.have.sent(expected._sQ);
+ });
});
describe('#clipboardPasteFrom', function () {