refactor: clarify comments in useKeyboard hook for resetKeyboardState function

This commit is contained in:
Adam Shiervani 2025-09-18 11:13:56 +02:00 committed by Siyuan Miao
parent a2b060b42e
commit 7a96aa3044
1 changed files with 1 additions and 2 deletions

View File

@ -281,8 +281,7 @@ export default function useKeyboard() {
}, [cancelKeepAlive, sendKeypressKeepAliveHidRpc]);
// resetKeyboardState is used to reset the keyboard state to no keys pressed and no modifiers.
// This is useful for macros and when the browser loses focus to ensure that the keyboard state
// is clean.
// This is useful for macros, in case of client-side rollover, and when the browser loses focus
const resetKeyboardState = useCallback(async () => {
// Cancel keepalive since we're resetting the keyboard state
cancelKeepAlive();