mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add original event to control events.
This commit is contained in:
parent
1fdcac5826
commit
b3eba8bd14
@ -8,8 +8,8 @@ import { NekoConnection } from './connection'
|
|||||||
import { Control } from '../types/state'
|
import { Control } from '../types/state'
|
||||||
|
|
||||||
export interface NekoControlEvents {
|
export interface NekoControlEvents {
|
||||||
['overlay.click']: () => void
|
['overlay.click']: (e: MouseEvent) => void
|
||||||
['overlay.contextmenu']: () => void
|
['overlay.contextmenu']: (e: MouseEvent) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NekoControl extends EventEmitter<NekoControlEvents> {
|
export class NekoControl extends EventEmitter<NekoControlEvents> {
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
@implicitControlRelease="control.release()"
|
@implicitControlRelease="control.release()"
|
||||||
@updateKeyboardModifiers="updateKeyboardModifiers($event)"
|
@updateKeyboardModifiers="updateKeyboardModifiers($event)"
|
||||||
@uploadDrop="uploadDrop($event)"
|
@uploadDrop="uploadDrop($event)"
|
||||||
@onAction="control.emit('overlay.' + $event)"
|
@onAction="control.emit('overlay.' + $event.action, $event.target)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
class="neko-overlay"
|
class="neko-overlay"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
:style="{ cursor }"
|
:style="{ cursor }"
|
||||||
@click.stop.prevent="$emit('onAction', 'click')"
|
@click.stop.prevent="$emit('onAction', { action: 'click', target: $event })"
|
||||||
@contextmenu.stop.prevent="$emit('onAction', 'contextmenu')"
|
@contextmenu.stop.prevent="$emit('onAction', { action: 'contextmenu', target: $event })"
|
||||||
@wheel.stop.prevent="onWheel"
|
@wheel.stop.prevent="onWheel"
|
||||||
@mousemove.stop.prevent="onMouseMove"
|
@mousemove.stop.prevent="onMouseMove"
|
||||||
@mousedown.stop.prevent="onMouseDown"
|
@mousedown.stop.prevent="onMouseDown"
|
||||||
|
Loading…
Reference in New Issue
Block a user