Compare commits

..

No commits in common. "b4b1b56fff0d0adaa84e8d50a4818b9e813bd1ae" and "20a23de227525bb72a3c72824bc9b228355162ad" have entirely different histories.

1 changed files with 2 additions and 8 deletions

View File

@ -29,7 +29,7 @@ var keyboardConfig = gadgetConfigItem{
// macOS default: 15 * 15 = 225ms https://discussions.apple.com/thread/1316947?sortBy=rank
// Linux default: 250ms https://man.archlinux.org/man/kbdrate.8.en
// Windows default: 1s `HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response\AutoRepeatDelay`
const autoReleaseKeyboardInterval = time.Millisecond * 225
const autoReleaseKeyboardInterval = time.Millisecond * 100
// Source: https://www.kernel.org/doc/Documentation/usb/gadget_hid.txt
var keyboardReportDesc = []byte{
@ -226,10 +226,7 @@ func (u *UsbGadget) performAutoRelease(key byte) {
return
}
_, err := u.keypressReport(key, false)
if err != nil {
u.log.Warn().Uint8("key", key).Msg("failed to release key")
}
u.keypressReport(key, false)
}
func (u *UsbGadget) listenKeyboardEvents() {
@ -481,9 +478,6 @@ func (u *UsbGadget) keypressReport(key byte, press bool) (KeysDownState, error)
func (u *UsbGadget) KeypressReport(key byte, press bool) error {
state, err := u.keypressReport(key, press)
if err != nil {
u.log.Warn().Uint8("key", key).Bool("press", press).Msg("failed to report key")
}
isRolledOver := state.Keys[0] == hidErrorRollOver
if isRolledOver {