set keyboard layout on control.

This commit is contained in:
Miroslav Šedivý 2021-02-18 23:14:47 +01:00
parent 7d4ad810b3
commit 1cea58d9e4
2 changed files with 22 additions and 0 deletions

View File

@ -117,6 +117,10 @@
sensitivity: 1, sensitivity: 1,
}, },
clipboard: null, clipboard: null,
keyboard: {
layout: '',
variant: '',
},
host_id: null, host_id: null,
implicit_hosting: false, implicit_hosting: false,
}, },
@ -280,6 +284,10 @@
Vue.set(this.state.control.scroll, 'sensitivity', value) Vue.set(this.state.control.scroll, 'sensitivity', value)
} }
public setKeyboard(layout: string, variant: string = '') {
Vue.set(this.state.control, 'keyboard', { layout, variant })
}
public setScreenSize(width: number, height: number, rate: number) { public setScreenSize(width: number, height: number, rate: number) {
//this.api.room.screenConfigurationChange({ screenConfiguration: { width, height, rate } }) //this.api.room.screenConfigurationChange({ screenConfiguration: { width, height, rate } })
this.websocket.send('screen/set', { width, height, rate }) this.websocket.send('screen/set', { width, height, rate })
@ -496,6 +504,14 @@
document.removeEventListener('click', this.unmute) document.removeEventListener('click', this.unmute)
} }
@Watch('controlling')
@Watch('state.control.keyboard')
updateKeyboard() {
if (this.controlling && this.state.control.keyboard.layout) {
this.websocket.send('keyboard/map', this.state.control.keyboard)
}
}
@Watch('state.screen.size') @Watch('state.screen.size')
onResize() { onResize() {
const { width, height } = this.state.screen.size const { width, height } = this.state.screen.size

View File

@ -50,6 +50,7 @@ export interface Video {
export interface Control { export interface Control {
scroll: Scroll scroll: Scroll
clipboard: Clipboard | null clipboard: Clipboard | null
keyboard: Keyboard
host_id: string | null host_id: string | null
implicit_hosting: boolean implicit_hosting: boolean
} }
@ -63,6 +64,11 @@ export interface Clipboard {
text: string text: string
} }
export interface Keyboard {
layout: string
variant: string
}
///////////////////////////// /////////////////////////////
// Screen // Screen
///////////////////////////// /////////////////////////////