diff --git a/src/component/main.vue b/src/component/main.vue index 948dd60d..63f8a581 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -37,6 +37,7 @@ @updateKeyboardModifiers="updateKeyboardModifiers($event)" @uploadDrop="uploadDrop($event)" @onAction="control.emit('overlay.' + $event.action, $event.target)" + @clipboard="control.paste($event)" /> diff --git a/src/component/overlay.vue b/src/component/overlay.vue index 1dfebd6f..852593cc 100644 --- a/src/component/overlay.vue +++ b/src/component/overlay.vue @@ -29,7 +29,7 @@ bottom: 0; width: 100%; height: 100%; - font-size: 0; + font-size: 1px; /* chrome would not paste text if 0px */ outline: 0; border: 0; color: transparent; @@ -227,8 +227,10 @@ return x } - // TODO: Custom clipboard sharing logic. - onInput() {} + onInput(e: InputEvent) { + this.$emit('clipboard', this._textarea.value) + this._textarea.value = '' + } onWheel(e: WheelEvent) { if (!this.isControling) { diff --git a/src/component/utils/guacamole-keyboard.js b/src/component/utils/guacamole-keyboard.js index f84616df..1f04f583 100644 --- a/src/component/utils/guacamole-keyboard.js +++ b/src/component/utils/guacamole-keyboard.js @@ -1427,9 +1427,9 @@ Guacamole.Keyboard = function Keyboard(element) { }; // Automatically type text entered into the wrapped field - element.addEventListener("input", handleInput, false); - element.addEventListener("compositionend", handleComposition, false); - + //20220428: NEKO: Removed because of clipboard handling. + //element.addEventListener("input", handleInput, false); + //element.addEventListener("compositionend", handleComposition, false); }; // Listen to given element, if any