mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
overlay focus only when hosting.
This commit is contained in:
parent
b963279296
commit
0062fc28aa
@ -451,7 +451,7 @@
|
||||
|
||||
/* Initialize Guacamole Keyboard */
|
||||
this.keyboard.onkeydown = (key: number) => {
|
||||
if (!this.focused || !this.hosting || this.locked) {
|
||||
if (!this.hosting || this.locked) {
|
||||
return true
|
||||
}
|
||||
|
||||
@ -459,7 +459,7 @@
|
||||
return false
|
||||
}
|
||||
this.keyboard.onkeyup = (key: number) => {
|
||||
if (!this.focused || !this.hosting || this.locked) {
|
||||
if (!this.hosting || this.locked) {
|
||||
return
|
||||
}
|
||||
|
||||
@ -700,7 +700,6 @@
|
||||
this.syncClipboard()
|
||||
}
|
||||
|
||||
this._overlay.focus()
|
||||
this.focused = true
|
||||
}
|
||||
|
||||
@ -724,5 +723,15 @@
|
||||
this._container.style.maxWidth = `${(this.horizontal / this.vertical) * offsetHeight}px`
|
||||
this._aspect.style.paddingBottom = `${(this.vertical / this.horizontal) * 100}%`
|
||||
}
|
||||
|
||||
@Watch('focused')
|
||||
@Watch('hosting')
|
||||
@Watch('locked')
|
||||
onFocus() {
|
||||
// in order to capture key events, overlay must be focused
|
||||
if (this.focused && this.hosting && !this.locked) {
|
||||
this._overlay.focus()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user