Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Teensy 2.0 handwired pad key stuck after Windows resumes from sleep #19871

Open
1 of 2 tasks
skagon opened this issue Feb 17, 2023 · 5 comments
Open
1 of 2 tasks

Comments

@skagon
Copy link

skagon commented Feb 17, 2023

Describe the Bug

I have a number of custom (self-made) keypads, all with my own QMK keyboard code and layouts. There is a problem when Windows resumes from sleep. After pressing a key on one of the keypads, which causes the computer to wake up, the key that I pressed on the keypad will remain pressed until I press any key (the same or other) on that pad. For instance, if I press [left arrow], I can't input the Windows PIN because the cursor is always moving to the left. If it's some other key, I either get spammed by keypresses, or if it's some modifier key, I'll log in but then it's pressed all the time, until I press any key on that particular keyboard.
I've seen it happen on three of my custom pads.
I'm on the latest, but it happened even before updating the master.

Keyboard Used

Teensy 2.0 hand-wired (multiple)

Link to product page (if applicable)

No response

Operating System

Windows 10 22H2

qmk doctor Output


Ψ QMK Doctor is checking your environment.
Ψ CLI version: 1.1.0
Ψ QMK home: D:/qmk
Ψ Detected Windows 10 (10.0.19044).
Ψ Git branch: master
Ψ Repo version: 0.19.12
Ψ - Latest master: 2023-02-17 00:30:24 +0800 (beb9fcb8bc) -- [Keyboard] Add Quarkeys Z40 keyboard (#19741)
Ψ - Latest upstream/master: 2023-02-17 07:29:22 +0100 (92ea53aeda) -- Added via keymap for bpiphany/pegasushoof (#19653)
Ψ - Latest upstream/develop: None
Ψ - Common ancestor with upstream/master: 2023-02-17 00:30:24 +0800 (beb9fcb8bc) -- [Keyboard] Add Quarkeys Z40 keyboard (#19741)
Ψ - Common ancestor with upstream/develop: None
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 10.1.0
Ψ Found avr-gcc version 8.5.0
Ψ Found avrdude version 6.4
Ψ Found dfu-util version 0.11
Ψ Found dfu-programmer version 0.7.2
Ψ Submodules are up to date.
Ψ Submodule status:
Ψ - lib/chibios: 2022-09-18 10:01:17 +0000 --  (0e9d558b5)
Ψ - lib/chibios-contrib: 2022-10-03 18:09:41 +0200 --  (bb8356fb)
Ψ - lib/googletest: 2021-06-11 06:37:43 -0700 --  (e2239ee6)
Ψ - lib/lufa: 2022-08-26 12:09:55 +1000 --  (549b97320)
Ψ - lib/pico-sdk: 2022-09-19 18:02:44 +0200 --  (8d56ea3)
Ψ - lib/printf: 2022-06-29 23:59:58 +0300 --  (c2e3b4e)
Ψ - lib/vusb: 2022-06-13 09:18:17 +1000 --  (819dbc1)
Ψ QMK is ready to go

Is AutoHotKey / Karabiner installed

  • AutoHotKey (Windows)
  • Karabiner (macOS)

Other keyboard-related software installed

No response

Additional Context

Perhaps related to #19600 and/or #16969 ?

@skagon skagon changed the title [Bug] Teensy 2.0 handwired pad key stuck after Windows resume from sleep [Bug] Teensy 2.0 handwired pad key stuck after Windows resumes from sleep Feb 18, 2023
@dansity
Copy link

dansity commented May 6, 2023

I have the same issue with the same board, the other merged solutions did not resolve it for this board.

@drashna
Copy link
Member

drashna commented May 22, 2023

does adding #define USB_SUSPEND_WAKEUP_DELAY 200 to your config.h help?

@skagon
Copy link
Author

skagon commented May 22, 2023

does adding #define USB_SUSPEND_WAKEUP_DELAY 200 to your config.h help?

I'm AFK (literally) for the next few days but I'll try that as soon as possible and get back to you. Thanks for the suggestion.

@skagon
Copy link
Author

skagon commented Jul 19, 2023

does adding #define USB_SUSPEND_WAKEUP_DELAY 200 to your config.h help?

Sorry it took me so long to test the setting and answer but yes, it appears that the USB_SUSPEND_WAKEUP_DELAY option fixes it.
I tried adding it to some of my pads – but not all, for control – and recompile everything after doing a git pull to update the QMK code. Pads without the USB_SUSPEND_WAKEUP_DELAY still exhibit the "key pressed whilst asleep remains stuck" problem. The pads with the setting work normally.
Does this count as a proper fix, or is it just a work-around? Also, would this be connected to this bug #20087 ? My custom-made ErgoDox also suffers from that (but none of the other pads).

@skagon
Copy link
Author

skagon commented Aug 2, 2023

does adding #define USB_SUSPEND_WAKEUP_DELAY 200 to your config.h help?

Ok, update: it does not work. At least, not consistently. My previous comment was made after putting the PC to sleep myself, from the start menu. Then re-awakened it within a few seconds of it turning off (a.k.a. sleep). Then everything seemed normal. But after the PC goes to sleep after a period of inactivity, same things happen, which means keys still get stuck apparently randomly. I've even had a keypad (with an Enter key) get stuck after I pressed the Enter key, but it did NOT wake up the PC. I had to press a button on a different keypad/board to wake up the PC, but the Enter key on the first keypad was still stuck! For the record, the keypads are all connected through a powered USB hub, so they don't need PC power to turn on.
So… what now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants