Commit Graph

26 Commits

Author SHA1 Message Date
Siyuan Miao 69ebe52718 chore: use dynamic duration for scheduleAutoRelease 2025-09-17 18:53:16 +02:00
Adam Shiervani ba4a835755 refactor: enhance keep-alive handling and jitter compensation in HID RPC
- Implemented staleness guard to ignore outdated keep-alive packets.
- Added jitter compensation logic to adjust timer extensions based on packet arrival times.
- Introduced new methods for managing keep-alive state and reset functionality in the Session struct.
- Updated auto-release delay mechanism to use dynamic durations based on keep-alive timing.
- Adjusted keep-alive interval in the UI to improve responsiveness.
2025-09-17 16:52:25 +02:00
Adam Shiervani 7edf621c38 fix: update auto-release keyboard interval to 225 2025-09-17 11:34:07 +02:00
Adam Shiervani 6d85f8505c fix: log warning on keypress report failure 2025-09-17 11:34:07 +02:00
Adam Shiervani 21fe0e3be9 fix: handle error in key release process and log warnings 2025-09-17 11:34:07 +02:00
Adam Shiervani 9c9833587a fix: correct Windows default auto-repeat delay comment from 1ms to 1s 2025-09-17 11:34:07 +02:00
Adam Shiervani 9b9ec0e6f4 refactor: enhance keyboard auto-release functionality and key state management 2025-09-17 11:34:07 +02:00
Adam Shiervani b430384ca8 refactor: simplify HID RPC keyboard input handling and improve key state management
- Updated `handleHidRPCKeyboardInput` to return errors directly instead of keys down state.
- Refactored `rpcKeyboardReport` and `rpcKeypressReport` to return errors instead of states.
- Introduced a queue for managing key down state updates in the `Session` struct to prevent input handling stalls.
- Adjusted the `UpdateKeysDown` method to handle state changes more efficiently.
- Removed unnecessary logging and commented-out code for clarity.
2025-09-17 11:34:07 +02:00
Siyuan Miao 23d8200b92 chore: use the proper key to send release command 2025-09-17 11:34:07 +02:00
Siyuan Miao b99d590c85 chore: add timeout for KeypressReport 2025-09-17 11:34:07 +02:00
Siyuan Miao ff1fecdceb fix: should cancelAutorelease when pressed is true 2025-09-17 11:34:07 +02:00
Siyuan Miao 60c9b304e5 chore: update logging for kbdAutoReleaseLock 2025-09-17 11:34:07 +02:00
Siyuan Miao 178ec879c6 chore: adjust auto release key interval 2025-09-17 11:34:07 +02:00
Siyuan Miao a1259c7414 clean up logging 2025-09-17 11:34:06 +02:00
Siyuan Miao 144d5fcd73 remove logging 2025-09-17 11:34:06 +02:00
Siyuan Miao 36cb18d2e1 send keepalive when pressing the key 2025-09-17 11:34:06 +02:00
Siyuan Miao 6f4787ad17 feat: release keyPress automatically 2025-09-17 11:34:06 +02:00
Aveline bcc307b147
feat: hid rpc channel (#755)
* feat: use hidRpcChannel to save bandwidth

* chore: simplify handshake of hid rpc

* add logs

* chore: add timeout when writing to hid endpoints

* fix issues

* chore: show hid rpc version

* refactor hidrpc marshal / unmarshal

* add queues for keyboard / mouse event

* chore: change logging level of JSONRPC send event to trace

* minor changes related to logging

* fix: nil check

* chore: add comments and remove unused code

* add useMouse

* chore: log msg data only when debug or trace mode

* chore: make tslint happy

* chore: unlock keyboardStateLock before calling onKeysDownChange

* chore: remove keyPressReportApiAvailable

* chore: change version handle

* chore: clean up unused functions

* remove comments
2025-09-04 22:27:56 +02:00
Marc Brooks 3ec243255b
Add ability to track modifier state on the device (#725)
Remove LED sync source option and add keypress reporting while still working with devices that haven't been upgraded
We return the modifiers as the valid bitmask so that the VirtualKeyboard and InfoBar 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 modifier keys in client and also removed the extraneous resetKeyboardState.
Manage state to eliminate rerenders by judicious use of useMemo.
Centralized keyboard layout and localized display maps
Move keyboardOptions to useKeyboardLayouts
Added translations for display maps.
Add documentation on the legacy support.

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.
Added exposition on isoCode management

Fix de-DE chars to reflect German E2 keyboard.
https://kbdlayout.info/kbdgre2/overview+virtualkeys

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.

Strong typed in the typescript realm.
Cleanup react state management to enable upgrading Zustand
2025-08-26 17:09:35 +02:00
Marc Brooks b4525b8760
chore/ Fix go lint error (#683) 2025-07-11 23:41:05 +02:00
rmschooley 3359f8fca4
Remove Out Endpoint Descriptors from Absolute Mouse and Relative Mouse (#542)
* Update hid_mouse_absolute.go

Added attribute to remove unnecessary out endpoint.

* Update hid_mouse_relative.go

Added attribute to remove unnecessary out endpoint.

* Update hid_keyboard.go

Added attribute to explicitly keep currently needed out endpoint and to make listed attributes consistent across the keyboard and mouse devices.

---------

Co-authored-by: Aveline <352441+ym@users.noreply.github.com>
2025-07-11 17:43:37 +02:00
Aveline 9c9335da31
chore: typo 'supression' should be 'suppression' (#671) 2025-07-03 17:28:00 +02:00
Aveline 3e7d8fb0f5
feat(usbgadget): suppress duplicate error logs (#630). 2025-06-20 18:52:37 +02:00
Aveline 0c5c69f2d3
feat: sync keyboard led status (#502) 2025-05-23 00:12:18 +02:00
Siyuan Miao 4c37f7e079 refactor: use structured logging 2025-04-11 00:43:46 +02:00
Siyuan Miao d1948adca8 refactor(usb): move usbconfig to a seperated package 2025-03-10 14:02:52 +01:00