aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/float.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index 17af03d3..2debdeff 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -40,14 +40,11 @@ class DisplayFloat extends Display {
['setContentScale', {handler: this._onMessageSetContentScale.bind(this)}]
]);
- this.setOnKeyDownHandlers([
- ['C', (e) => {
- if (e.ctrlKey && !window.getSelection().toString()) {
- this._copySelection();
- return true;
- }
- return false;
- }]
+ this.registerActions([
+ ['copy-host-selection', () => this._copySelection()]
+ ]);
+ this.registerHotkeys([
+ {key: 'C', modifiers: ['ctrl'], action: 'copy-host-selection'}
]);
}
@@ -168,7 +165,9 @@ class DisplayFloat extends Display {
// Private
_copySelection() {
+ if (window.getSelection().toString()) { return false; }
this._invoke('copySelection');
+ return true;
}
_clearAutoPlayTimer() {