remove logging

This commit is contained in:
Siyuan Miao 2025-09-11 15:00:03 +02:00
parent 56dfb4febd
commit 9b6bf6217a
1 changed files with 1 additions and 17 deletions

View File

@ -390,20 +390,11 @@ var KeyCodeToMaskMap = map[byte]byte{
}
func (u *UsbGadget) keypressReport(key byte, press bool, autoRelease bool) (KeysDownState, error) {
ll := u.log.Info().Str("component", "kbd")
ll.Uint8("key", key).Msg("locking keyboardLock")
u.keyboardLock.Lock()
defer func() {
u.keyboardLock.Unlock()
ll.Uint8("key", key).Msg("unlocked keyboardLock")
}()
defer u.keyboardLock.Unlock()
ll.Uint8("key", key).Msg("resetting user input time")
defer u.resetUserInputTime()
ll.Uint8("key", key).Msg("locked keyboardLock")
// IMPORTANT: This code parallels the logic in the kernel's hid-gadget driver
// for handling key presses and releases. It ensures that the USB gadget
// behaves similarly to a real USB HID keyboard. This logic is paralleled
@ -461,8 +452,6 @@ func (u *UsbGadget) keypressReport(key byte, press bool, autoRelease bool) (Keys
}
}
ll.Uint8("key", key).Msg("checking if auto-release is enabled")
// if autoRelease {
// u.kbdAutoReleaseLock.Lock()
// u.kbdAutoReleaseLock.Unlock()
@ -480,8 +469,6 @@ func (u *UsbGadget) keypressReport(key byte, press bool, autoRelease bool) (Keys
// }
// }
ll.Uint8("key", key).Msg("writing keypress report to hidg0")
err := u.keyboardWriteHidFile(modifier, keys)
if err != nil {
u.log.Warn().Uint8("modifier", modifier).Uints8("keys", keys).Msg("Could not write keypress report to hidg0")
@ -495,14 +482,11 @@ func (u *UsbGadget) keypressReport(key byte, press bool, autoRelease bool) (Keys
}
if autoRelease {
ll.Uint8("key", key).Msg("scheduling auto-release")
u.scheduleAutoRelease(key)
}
} else {
if autoRelease {
ll.Uint8("key", key).Msg("canceling auto-release")
u.cancelAutoRelease()
ll.Uint8("key", key).Msg("auto-release canceled")
}
}