Only send QEMU Extended Key Event if we have a scan code

Servers will assume that a scan code is present if this message type
is used, so fall back to the standard key event message if we don't
know the scan code.
This commit is contained in:
Pierre Ossman
2017-07-07 15:06:13 +02:00
parent 4093c37f28
commit be70fe0a3d
2 changed files with 10 additions and 9 deletions
+8
View File
@@ -224,6 +224,14 @@ describe('Remote Frame Buffer Protocol Client', function() {
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 () {