Commit Graph

8 Commits

Author SHA1 Message Date
Siyuan Miao da176f73e1 clean up code 2025-09-17 17:21:27 +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 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 e09c6daccd fix: handshake won't happen if webrtc reconnects 2025-09-17 11:34:07 +02:00
Siyuan Miao d829aa36f0 chore: use ordered unreliable channel for pointer events 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
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