mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
cursor image as WS event.
This commit is contained in:
parent
94186f3ef6
commit
818e07fc8b
@ -81,14 +81,9 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
|
|||||||
// TODO: Handle.
|
// TODO: Handle.
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Refactor.
|
protected [EVENT.CURSOR_IMAGE]({ uri, width, height, x, y }: message.CursorImage) {
|
||||||
protected ['cursor/image']({ payload }: any) {
|
console.log('EVENT.CURSOR_IMAGE')
|
||||||
console.log('cursor/image')
|
Vue.set(this.state.control, 'cursor', { uri, width, height, x, y })
|
||||||
Vue.set(this.state.control, 'cursor', {
|
|
||||||
uri: payload.Uri,
|
|
||||||
hot_x: payload.Xhot,
|
|
||||||
hot_y: payload.Yhot,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
|
@ -68,8 +68,8 @@
|
|||||||
get cursor(): string {
|
get cursor(): string {
|
||||||
if (!this.control.cursor) return 'auto'
|
if (!this.control.cursor) return 'auto'
|
||||||
|
|
||||||
const { uri, hot_x, hot_y } = this.control.cursor
|
const { uri, x, y } = this.control.cursor
|
||||||
return 'url(' + uri + ') ' + hot_x + ' ' + hot_y + ', auto'
|
return 'url(' + uri + ') ' + x + ' ' + y + ', auto'
|
||||||
}
|
}
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -28,4 +28,6 @@ export const CLIPBOARD_SET = 'clipboard/set'
|
|||||||
export const KEYBOARD_MODIFIERS = 'keyboard/modifiers'
|
export const KEYBOARD_MODIFIERS = 'keyboard/modifiers'
|
||||||
export const KEYBOARD_LAYOUT = 'keyboard/layout'
|
export const KEYBOARD_LAYOUT = 'keyboard/layout'
|
||||||
|
|
||||||
|
export const CURSOR_IMAGE = 'cursor/image'
|
||||||
|
|
||||||
export const BORADCAST_STATUS = 'broadcast/status'
|
export const BORADCAST_STATUS = 'broadcast/status'
|
||||||
|
@ -146,6 +146,19 @@ export interface KeyboardLayout {
|
|||||||
layout: string
|
layout: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////////////////
|
||||||
|
// Cursor
|
||||||
|
/////////////////////////////
|
||||||
|
|
||||||
|
export interface CursorImage {
|
||||||
|
event: string | undefined
|
||||||
|
uri: string
|
||||||
|
width: number
|
||||||
|
height: number
|
||||||
|
x: number
|
||||||
|
y: number
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// Broadcast
|
// Broadcast
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
|
@ -48,8 +48,10 @@ export interface Scroll {
|
|||||||
|
|
||||||
export interface Cursor {
|
export interface Cursor {
|
||||||
uri: string
|
uri: string
|
||||||
hot_x: number
|
width: number
|
||||||
hot_y: number
|
height: number
|
||||||
|
x: number
|
||||||
|
y: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Clipboard {
|
export interface Clipboard {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user