add shared cursor as image tag.

This commit is contained in:
Miroslav Šedivý
2021-02-11 19:03:31 +01:00
parent 723ec821f3
commit 6cfe39e6c5
6 changed files with 65 additions and 11 deletions

View File

@ -101,11 +101,6 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
this.emit('connection.disconnect', message)
}
protected [EVENT.CURSOR_IMAGE]({ uri, width, height, x, y }: message.CursorImage) {
this._log.debug('EVENT.CURSOR_IMAGE')
Vue.set(this.state.control, 'cursor', { uri, width, height, x, y })
}
/////////////////////////////
// Signal Events
/////////////////////////////
@ -180,6 +175,7 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
Vue.set(this.state.screen, 'size', { width, height, rate })
this.emit('room.screen.updated', width, height, rate)
}
/////////////////////////////
// Clipboard Events
/////////////////////////////
@ -190,6 +186,20 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
this.emit('room.clipboard.updated', text)
}
/////////////////////////////
// Cursor Events
/////////////////////////////
protected [EVENT.CURSOR_IMAGE]({ uri, width, height, x, y }: message.CursorImage) {
this._log.debug('EVENT.CURSOR_IMAGE')
Vue.set(this.state.control.cursor, 'image', { uri, width, height, x, y })
}
protected [EVENT.CURSOR_POSITION]({ x, y }: message.CursorPosition) {
this._log.debug('EVENT.CURSOR_IMAGE')
Vue.set(this.state.control.cursor, 'position', { x, y })
}
/////////////////////////////
// Broadcast Events
/////////////////////////////