mirror of https://github.com/jetkvm/kvm.git
Compare commits
No commits in common. "b4b1b56fff0d0adaa84e8d50a4818b9e813bd1ae" and "20a23de227525bb72a3c72824bc9b228355162ad" have entirely different histories.
b4b1b56fff
...
20a23de227
|
|
@ -29,7 +29,7 @@ var keyboardConfig = gadgetConfigItem{
|
||||||
// macOS default: 15 * 15 = 225ms https://discussions.apple.com/thread/1316947?sortBy=rank
|
// macOS default: 15 * 15 = 225ms https://discussions.apple.com/thread/1316947?sortBy=rank
|
||||||
// Linux default: 250ms https://man.archlinux.org/man/kbdrate.8.en
|
// Linux default: 250ms https://man.archlinux.org/man/kbdrate.8.en
|
||||||
// Windows default: 1s `HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response\AutoRepeatDelay`
|
// 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
|
// Source: https://www.kernel.org/doc/Documentation/usb/gadget_hid.txt
|
||||||
var keyboardReportDesc = []byte{
|
var keyboardReportDesc = []byte{
|
||||||
|
|
@ -226,10 +226,7 @@ func (u *UsbGadget) performAutoRelease(key byte) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := u.keypressReport(key, false)
|
u.keypressReport(key, false)
|
||||||
if err != nil {
|
|
||||||
u.log.Warn().Uint8("key", key).Msg("failed to release key")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UsbGadget) listenKeyboardEvents() {
|
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 {
|
func (u *UsbGadget) KeypressReport(key byte, press bool) error {
|
||||||
state, err := u.keypressReport(key, press)
|
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
|
isRolledOver := state.Keys[0] == hidErrorRollOver
|
||||||
|
|
||||||
if isRolledOver {
|
if isRolledOver {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue