mirror of https://github.com/jetkvm/kvm.git
Compare commits
10 Commits
80e2881fe8
...
8f86d6ed26
Author | SHA1 | Date |
---|---|---|
|
8f86d6ed26 | |
|
cbc3f2016f | |
|
580b3397bf | |
|
ce95be8af9 | |
|
c28f3b4cd0 | |
|
ad59ecea09 | |
|
681b9c0b6e | |
|
efb7539537 | |
|
f26862d2e3 | |
|
23e74bfff8 |
|
@ -284,6 +284,10 @@ function KeyboardWrapper() {
|
||||||
preventMouseUpDefault={true}
|
preventMouseUpDefault={true}
|
||||||
stopMouseDownPropagation={true}
|
stopMouseDownPropagation={true}
|
||||||
stopMouseUpPropagation={true}
|
stopMouseUpPropagation={true}
|
||||||
|
physicalKeyboardHighlight={true}
|
||||||
|
physicalKeyboardHighlightPreventDefault={true}
|
||||||
|
physicalKeyboardHighlightTextColor="black"
|
||||||
|
physicalKeyboardHighlightBgColor="lightblue"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="controlArrows">
|
<div className="controlArrows">
|
||||||
|
@ -301,6 +305,10 @@ function KeyboardWrapper() {
|
||||||
preventMouseUpDefault={true}
|
preventMouseUpDefault={true}
|
||||||
stopMouseDownPropagation={true}
|
stopMouseDownPropagation={true}
|
||||||
stopMouseUpPropagation={true}
|
stopMouseUpPropagation={true}
|
||||||
|
physicalKeyboardHighlight={true}
|
||||||
|
physicalKeyboardHighlightPreventDefault={true}
|
||||||
|
physicalKeyboardHighlightTextColor="black"
|
||||||
|
physicalKeyboardHighlightBgColor="lightblue"
|
||||||
/>
|
/>
|
||||||
<Keyboard
|
<Keyboard
|
||||||
baseClass="simple-keyboard-arrows"
|
baseClass="simple-keyboard-arrows"
|
||||||
|
@ -315,6 +323,10 @@ function KeyboardWrapper() {
|
||||||
preventMouseUpDefault={true}
|
preventMouseUpDefault={true}
|
||||||
stopMouseDownPropagation={true}
|
stopMouseDownPropagation={true}
|
||||||
stopMouseUpPropagation={true}
|
stopMouseUpPropagation={true}
|
||||||
|
physicalKeyboardHighlight={true}
|
||||||
|
physicalKeyboardHighlightPreventDefault={true}
|
||||||
|
physicalKeyboardHighlightTextColor="black"
|
||||||
|
physicalKeyboardHighlightBgColor="lightblue"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{ /* TODO add optional number pad */ }
|
{ /* TODO add optional number pad */ }
|
||||||
|
|
15
webrtc.go
15
webrtc.go
|
@ -23,7 +23,6 @@ type Session struct {
|
||||||
HidChannel *webrtc.DataChannel
|
HidChannel *webrtc.DataChannel
|
||||||
DiskChannel *webrtc.DataChannel
|
DiskChannel *webrtc.DataChannel
|
||||||
shouldUmountVirtualMedia bool
|
shouldUmountVirtualMedia bool
|
||||||
rpcQueue chan webrtc.DataChannelMessage
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type SessionConfig struct {
|
type SessionConfig struct {
|
||||||
|
@ -107,12 +106,6 @@ func newSession(config SessionConfig) (*Session, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
session := &Session{peerConnection: peerConnection}
|
session := &Session{peerConnection: peerConnection}
|
||||||
session.rpcQueue = make(chan webrtc.DataChannelMessage, 256)
|
|
||||||
go func() {
|
|
||||||
for msg := range session.rpcQueue {
|
|
||||||
onRPCMessage(msg, session)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
peerConnection.OnDataChannel(func(d *webrtc.DataChannel) {
|
peerConnection.OnDataChannel(func(d *webrtc.DataChannel) {
|
||||||
scopedLogger.Info().Str("label", d.Label()).Uint16("id", *d.ID()).Msg("New DataChannel")
|
scopedLogger.Info().Str("label", d.Label()).Uint16("id", *d.ID()).Msg("New DataChannel")
|
||||||
|
@ -120,8 +113,7 @@ func newSession(config SessionConfig) (*Session, error) {
|
||||||
case "rpc":
|
case "rpc":
|
||||||
session.RPCChannel = d
|
session.RPCChannel = d
|
||||||
d.OnMessage(func(msg webrtc.DataChannelMessage) {
|
d.OnMessage(func(msg webrtc.DataChannelMessage) {
|
||||||
// Enqueue to ensure ordered processing
|
go onRPCMessage(msg, session)
|
||||||
session.rpcQueue <- msg
|
|
||||||
})
|
})
|
||||||
triggerOTAStateUpdate()
|
triggerOTAStateUpdate()
|
||||||
triggerVideoStateUpdate()
|
triggerVideoStateUpdate()
|
||||||
|
@ -197,11 +189,6 @@ func newSession(config SessionConfig) (*Session, error) {
|
||||||
if session == currentSession {
|
if session == currentSession {
|
||||||
currentSession = nil
|
currentSession = nil
|
||||||
}
|
}
|
||||||
// Stop RPC processor
|
|
||||||
if session.rpcQueue != nil {
|
|
||||||
close(session.rpcQueue)
|
|
||||||
session.rpcQueue = nil
|
|
||||||
}
|
|
||||||
if session.shouldUmountVirtualMedia {
|
if session.shouldUmountVirtualMedia {
|
||||||
if err := rpcUnmountImage(); err != nil {
|
if err := rpcUnmountImage(); err != nil {
|
||||||
scopedLogger.Warn().Err(err).Msg("unmount image failed on connection close")
|
scopedLogger.Warn().Err(err).Msg("unmount image failed on connection close")
|
||||||
|
|
Loading…
Reference in New Issue