diff --git a/src/component/internal/control.ts b/src/component/internal/control.ts index f9bde5d1..974ea6f0 100644 --- a/src/component/internal/control.ts +++ b/src/component/internal/control.ts @@ -8,8 +8,8 @@ import { NekoConnection } from './connection' import { Control } from '../types/state' export interface NekoControlEvents { - ['overlay.click']: () => void - ['overlay.contextmenu']: () => void + ['overlay.click']: (e: MouseEvent) => void + ['overlay.contextmenu']: (e: MouseEvent) => void } export class NekoControl extends EventEmitter { diff --git a/src/component/main.vue b/src/component/main.vue index d226eb80..de763a8d 100644 --- a/src/component/main.vue +++ b/src/component/main.vue @@ -34,7 +34,7 @@ @implicitControlRelease="control.release()" @updateKeyboardModifiers="updateKeyboardModifiers($event)" @uploadDrop="uploadDrop($event)" - @onAction="control.emit('overlay.' + $event)" + @onAction="control.emit('overlay.' + $event.action, $event.target)" /> diff --git a/src/component/overlay.vue b/src/component/overlay.vue index 69591a81..fe38d7a6 100644 --- a/src/component/overlay.vue +++ b/src/component/overlay.vue @@ -4,8 +4,8 @@ class="neko-overlay" tabindex="0" :style="{ cursor }" - @click.stop.prevent="$emit('onAction', 'click')" - @contextmenu.stop.prevent="$emit('onAction', 'contextmenu')" + @click.stop.prevent="$emit('onAction', { action: 'click', target: $event })" + @contextmenu.stop.prevent="$emit('onAction', { action: 'contextmenu', target: $event })" @wheel.stop.prevent="onWheel" @mousemove.stop.prevent="onMouseMove" @mousedown.stop.prevent="onMouseDown"