mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
overlay use control instead of event emitter.
This commit is contained in:
@ -49,6 +49,7 @@
|
||||
import GuacamoleKeyboard from './utils/guacamole-keyboard'
|
||||
import { KeyTable, keySymsRemap } from './utils/keyboard-remapping'
|
||||
import { getFilesFromDataTansfer } from './utils/file-upload'
|
||||
import { NekoControl } from './internal/control'
|
||||
import { NekoWebRTC } from './internal/webrtc'
|
||||
import { Session, Scroll } from './types/state'
|
||||
import { CursorPosition, CursorImage } from './types/webrtc'
|
||||
@ -72,6 +73,9 @@
|
||||
private keyboard = GuacamoleKeyboard()
|
||||
private focused = false
|
||||
|
||||
@Prop()
|
||||
private readonly control!: NekoControl
|
||||
|
||||
@Prop()
|
||||
private readonly sessions!: Record<string, Session>
|
||||
|
||||
@ -231,7 +235,7 @@
|
||||
}
|
||||
|
||||
onInput(e: InputEvent) {
|
||||
this.$emit('clipboard', this._textarea.value)
|
||||
this.control.paste(this._textarea.value)
|
||||
this._textarea.value = ''
|
||||
}
|
||||
|
||||
@ -560,7 +564,7 @@
|
||||
implicitControlRequest(e: MouseEvent) {
|
||||
if (this.implicitControl && e.type === 'mousedown' && this.reqMouseDown == null) {
|
||||
this.reqMouseDown = e
|
||||
this.$emit('implicitControlRequest')
|
||||
this.control.request()
|
||||
}
|
||||
|
||||
if (this.implicitControl && e.type === 'mouseup' && this.reqMouseUp == null) {
|
||||
@ -571,7 +575,7 @@
|
||||
// unused
|
||||
implicitControlRelease() {
|
||||
if (this.implicitControl) {
|
||||
this.$emit('implicitControlRelease')
|
||||
this.control.release()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user