Compare commits

..

10 Commits

Author SHA1 Message Date
Marc Brooks 8f86d6ed26
Merge cbc3f2016f into bb87fb5a1a 2025-08-22 06:47:17 -04:00
Marc Brooks cbc3f2016f Move keyboardOptions to useKeyboardLayouts
Manage state to eliminate rerenders by judicious use of useMemo.
Also removed the extraneous resetKeyboardState.
2025-08-21 18:10:03 +00:00
Marc Brooks 580b3397bf Finish removing Polish keyboard 2025-08-21 16:40:10 +00:00
Marc Brooks ce95be8af9 Added exposition on isoCode management 2025-08-21 16:37:46 +00:00
Marc Brooks c28f3b4cd0 Clean up repeating keys and physical key highlighting 2025-08-21 16:37:16 +00:00
Marc Brooks ad59ecea09 Remove Polish keyboard until completed 2025-08-21 16:36:22 +00:00
Marc Brooks 681b9c0b6e
Fix compiler error
Using { send } gives the resp a type instead of any
2025-08-20 23:48:40 -05:00
Marc Brooks efb7539537
Fix de-DE chars to reflect German E2 keyboard.
https://kbdlayout.info/kbdgre2/overview+virtualkeys
Added translations for display maps.
2025-08-20 23:45:19 -05:00
Marc Brooks f26862d2e3
Centralized keyboard layout and localized display maps
The Polish programmer keyboard is incomplete WIP.
2025-08-20 21:02:08 -05:00
Marc Brooks 23e74bfff8
Add ability to track modifier state on the device
Remove LED sync source and add keypress reporting
We return the modifiers as the valid bitmask so that the VirtualKeyboard can represent the correct keys as down. This is important when we have strokes like Left-Control + Right-Control + Keypad-1 (used in switching KVMs and such)
Fix handling of meta keys in client
Ran go modernize
Morphs Interface{} to any
Ranges over SplitSeq and FieldSeq for iterating splits
Used min for end calculation remote_mount.Read
Used range 16 in wol.createMagicPacket
DID NOT apply the Omitempty cleanup.
Use the KeysDownState for the infobar
Strong typed in the typescript realm.
Enable still working with devices that haven't been upgraded
Return the KeysDownState from keyboardReport
Clear out the hidErrorRollOver once sent to reset the keyboard to nothing down.
Handles the returned KeysDownState from keyboardReport
Now passes all logic through handleKeyPress.
If we get a state back from a keyboardReport, use it and also enable keypressReport because we now know it's an upgraded device.
Add documentation on the legacy support.
Cleanup react state management to enable upgrading Zustand
2025-08-20 02:11:57 -05:00
2 changed files with 13 additions and 14 deletions

View File

@ -284,6 +284,10 @@ function KeyboardWrapper() {
preventMouseUpDefault={true}
stopMouseDownPropagation={true}
stopMouseUpPropagation={true}
physicalKeyboardHighlight={true}
physicalKeyboardHighlightPreventDefault={true}
physicalKeyboardHighlightTextColor="black"
physicalKeyboardHighlightBgColor="lightblue"
/>
<div className="controlArrows">
@ -301,6 +305,10 @@ function KeyboardWrapper() {
preventMouseUpDefault={true}
stopMouseDownPropagation={true}
stopMouseUpPropagation={true}
physicalKeyboardHighlight={true}
physicalKeyboardHighlightPreventDefault={true}
physicalKeyboardHighlightTextColor="black"
physicalKeyboardHighlightBgColor="lightblue"
/>
<Keyboard
baseClass="simple-keyboard-arrows"
@ -315,6 +323,10 @@ function KeyboardWrapper() {
preventMouseUpDefault={true}
stopMouseDownPropagation={true}
stopMouseUpPropagation={true}
physicalKeyboardHighlight={true}
physicalKeyboardHighlightPreventDefault={true}
physicalKeyboardHighlightTextColor="black"
physicalKeyboardHighlightBgColor="lightblue"
/>
</div>
{ /* TODO add optional number pad */ }

View File

@ -23,7 +23,6 @@ type Session struct {
HidChannel *webrtc.DataChannel
DiskChannel *webrtc.DataChannel
shouldUmountVirtualMedia bool
rpcQueue chan webrtc.DataChannelMessage
}
type SessionConfig struct {
@ -107,12 +106,6 @@ func newSession(config SessionConfig) (*Session, error) {
return nil, err
}
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) {
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":
session.RPCChannel = d
d.OnMessage(func(msg webrtc.DataChannelMessage) {
// Enqueue to ensure ordered processing
session.rpcQueue <- msg
go onRPCMessage(msg, session)
})
triggerOTAStateUpdate()
triggerVideoStateUpdate()
@ -197,11 +189,6 @@ func newSession(config SessionConfig) (*Session, error) {
if session == currentSession {
currentSession = nil
}
// Stop RPC processor
if session.rpcQueue != nil {
close(session.rpcQueue)
session.rpcQueue = nil
}
if session.shouldUmountVirtualMedia {
if err := rpcUnmountImage(); err != nil {
scopedLogger.Warn().Err(err).Msg("unmount image failed on connection close")