mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
control add button and optionally pos.
This commit is contained in:
parent
3382126f40
commit
3180102006
@ -45,16 +45,28 @@ export class NekoControl extends EventEmitter<NekoControlEvents> {
|
||||
this._connection.websocket.send(EVENT.CONTROL_SCROLL, { x, y } as message.ControlPos)
|
||||
}
|
||||
|
||||
public keyPress(keysym: number) {
|
||||
this._connection.websocket.send(EVENT.CONTROL_KEYPRESS, { keysym } as message.ControlKey)
|
||||
public buttonPress(code: number, x?: number, y?: number) {
|
||||
this._connection.websocket.send(EVENT.CONTROL_BUTTONPRESS, { code, x, y } as message.ControlButton)
|
||||
}
|
||||
|
||||
public keyDown(keysym: number) {
|
||||
this._connection.websocket.send(EVENT.CONTROL_KEYDOWN, { keysym } as message.ControlKey)
|
||||
public buttonDown(code: number, x?: number, y?: number) {
|
||||
this._connection.websocket.send(EVENT.CONTROL_BUTTONDOWN, { code, x, y } as message.ControlButton)
|
||||
}
|
||||
|
||||
public keyUp(keysym: number) {
|
||||
this._connection.websocket.send(EVENT.CONTROL_KEYUP, { keysym } as message.ControlKey)
|
||||
public buttonUp(code: number, x?: number, y?: number) {
|
||||
this._connection.websocket.send(EVENT.CONTROL_BUTTONUP, { code, x, y } as message.ControlButton)
|
||||
}
|
||||
|
||||
public keyPress(keysym: number, x?: number, y?: number) {
|
||||
this._connection.websocket.send(EVENT.CONTROL_KEYPRESS, { keysym, x, y } as message.ControlKey)
|
||||
}
|
||||
|
||||
public keyDown(keysym: number, x?: number, y?: number) {
|
||||
this._connection.websocket.send(EVENT.CONTROL_KEYDOWN, { keysym, x, y } as message.ControlKey)
|
||||
}
|
||||
|
||||
public keyUp(keysym: number, x?: number, y?: number) {
|
||||
this._connection.websocket.send(EVENT.CONTROL_KEYUP, { keysym, x, y } as message.ControlKey)
|
||||
}
|
||||
|
||||
public cut() {
|
||||
|
@ -25,6 +25,9 @@ export const CONTROL_REQUEST = 'control/request'
|
||||
// mouse
|
||||
export const CONTROL_MOVE = 'control/move'
|
||||
export const CONTROL_SCROLL = 'control/scroll'
|
||||
export const CONTROL_BUTTONPRESS = 'control/buttonpress'
|
||||
export const CONTROL_BUTTONDOWN = 'control/buttondown'
|
||||
export const CONTROL_BUTTONUP = 'control/buttonup'
|
||||
// keyboard
|
||||
export const CONTROL_KEYPRESS = 'control/keypress'
|
||||
export const CONTROL_KEYDOWN = 'control/keydown'
|
||||
|
@ -113,7 +113,11 @@ export interface ControlPos {
|
||||
y: number
|
||||
}
|
||||
|
||||
export interface ControlKey {
|
||||
export interface ControlButton extends Partial<ControlPos> {
|
||||
code: number
|
||||
}
|
||||
|
||||
export interface ControlKey extends Partial<ControlPos> {
|
||||
keysym: number
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user