diff --git a/core/input/keyboard.js b/core/input/keyboard.js index 3cc89174..e7209613 100644 --- a/core/input/keyboard.js +++ b/core/input/keyboard.js @@ -208,6 +208,14 @@ export default class Keyboard { return; } + // The event gives us some very useful info about modkeys but + // when fingerprinting is on, it only stores this info without + // sending it, so we have to manually send the modkeys ourselves + if (browser.isFirefox()) { + this._updateModifierState(false, false); + this._updateModifierState(e, true); + } + this._sendKeyEvent(keysym, code, true, numlock, capslock); } @@ -245,6 +253,22 @@ export default class Keyboard { } } + _updateModifierState(e, isKeyDown) { + const modMap = { + shiftKey: KeyTable.XK_Shift_L, + ctrlKey: KeyTable.XK_Control_L, + altKey: KeyTable.XK_Alt_L, + metaKey: KeyTable.XK_Super_L + }; + + for (let key in modMap) { + if(!e) this._sendKeyEvent(modMap[key], key, false); + if (e[key]) { + this._sendKeyEvent(modMap[key], key, isKeyDown); + } + } + } + _interruptAltGrSequence() { if (this._altGrArmed) { this._altGrArmed = false;