mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add new WS keyboard event
This commit is contained in:
@ -27,6 +27,7 @@ export const EVENT = {
|
||||
REQUESTING: 'control/requesting',
|
||||
CLIPBOARD: 'control/clipboard',
|
||||
GIVE: 'control/give',
|
||||
KEYBOARD: 'control/keyboard'
|
||||
},
|
||||
CHAT: {
|
||||
MESSAGE: 'chat/message',
|
||||
@ -67,6 +68,7 @@ export type ControlEvents =
|
||||
| typeof EVENT.CONTROL.REQUEST
|
||||
| typeof EVENT.CONTROL.GIVE
|
||||
| typeof EVENT.CONTROL.CLIPBOARD
|
||||
| typeof EVENT.CONTROL.KEYBOARD
|
||||
|
||||
export type SystemEvents = typeof EVENT.SYSTEM.DISCONNECT
|
||||
export type MemberEvents = typeof EVENT.MEMBER.LIST | typeof EVENT.MEMBER.CONNECTED | typeof EVENT.MEMBER.DISCONNECTED
|
||||
|
@ -31,6 +31,7 @@ export type WebSocketPayloads =
|
||||
| ControlPayload
|
||||
| ControlRequestPayload
|
||||
| ControlClipboardPayload
|
||||
| ControlKeyboardPayload
|
||||
| ChatPayload
|
||||
| ChatSendPayload
|
||||
| EmojiSendPayload
|
||||
@ -125,6 +126,10 @@ export interface ControlClipboardPayload {
|
||||
text: string
|
||||
}
|
||||
|
||||
export interface ControlKeyboardPayload {
|
||||
layout: string
|
||||
}
|
||||
|
||||
/*
|
||||
CHAT PAYLOADS
|
||||
*/
|
||||
|
@ -133,5 +133,13 @@ export const actions = actionTree(
|
||||
|
||||
$client.sendMessage(EVENT.ADMIN.GIVE, { id: member.id })
|
||||
},
|
||||
|
||||
changeKeyboard({ getters }) {
|
||||
if (!accessor.connected || !getters.hosting) {
|
||||
return
|
||||
}
|
||||
|
||||
$client.sendMessage(EVENT.CONTROL.KEYBOARD, { layout: accessor.settings.keyboard_layout })
|
||||
}
|
||||
},
|
||||
)
|
||||
|
Reference in New Issue
Block a user