add overlay events.

This commit is contained in:
Miroslav Šedivý 2022-01-30 17:09:35 +01:00
parent bd5f02223a
commit de62a349ed
3 changed files with 7 additions and 2 deletions

View File

@ -39,6 +39,10 @@ export interface NekoEvents {
['room.screen.updated']: (width: number, height: number, rate: number) => void ['room.screen.updated']: (width: number, height: number, rate: number) => void
['room.clipboard.updated']: (text: string) => void ['room.clipboard.updated']: (text: string) => void
['room.broadcast.status']: (isActive: boolean, url?: string) => void ['room.broadcast.status']: (isActive: boolean, url?: string) => void
// overlay events
['overlay.click']: () => void
['overlay.contextmenu']: () => void
} }
export class NekoMessages extends EventEmitter<NekoEvents> { export class NekoMessages extends EventEmitter<NekoEvents> {

View File

@ -28,6 +28,7 @@
@implicitControlRelease="connection.websocket.send('control/release')" @implicitControlRelease="connection.websocket.send('control/release')"
@updateKeyboardModifiers="updateKeyboardModifiers($event)" @updateKeyboardModifiers="updateKeyboardModifiers($event)"
@uploadDrop="uploadDrop($event)" @uploadDrop="uploadDrop($event)"
@onAction="events.emit('overlay.' + $event)"
/> />
</div> </div>
</div> </div>

View File

@ -4,8 +4,8 @@
class="neko-overlay" class="neko-overlay"
tabindex="0" tabindex="0"
:style="{ cursor }" :style="{ cursor }"
@click.stop.prevent @click.stop.prevent="$emit('onAction', 'click')"
@contextmenu.stop.prevent @contextmenu.stop.prevent="$emit('onAction', 'contextmenu')"
@wheel.stop.prevent="onWheel" @wheel.stop.prevent="onWheel"
@mousemove.stop.prevent="onMouseMove" @mousemove.stop.prevent="onMouseMove"
@mousedown.stop.prevent="onMouseDown" @mousedown.stop.prevent="onMouseDown"