You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Support for double-tap hotkeys (e.g., Ctrl+Ctrl) #248
It would be great to add support for double-tap hotkeys (sequential key presses) as an alternative to simultaneous key combinations.
Example use cases:
Ctrl+Ctrl (double-tap Ctrl)
Alt+Alt (double-tap Alt)
Shift+Shift (double-tap Shift)
Why is this useful?
Ergonomics — double-tap is easier to press than modifier+key combinations
Fewer conflicts — most applications don't use double-tap shortcuts, so less chance of hotkey collision
Popular pattern — many tools use this approach (e.g., JetBrains IDEs use double-Shift for "Search Everywhere", IntelliJ uses double-Ctrl for "Run Anything")
Accessibility — single-hand operation without stretching fingers
Suggested implementation
The pynput library supports this through event timing. Here's a basic approach:
frompynputimportkeyboardimporttimeclassDoubleTapDetector:
def__init__(self, key, callback, threshold=0.3):
self.key=keyself.callback=callbackself.threshold=threshold# secondsself.last_press=0self.last_release=0defon_press(self, key):
ifkey==self.key:
current=time.time()
# Check if this is a double-tapifcurrent-self.last_release<self.threshold:
self.callback()
self.last_press=currentdefon_release(self, key):
ifkey==self.key:
self.last_release=time.time()
Activity
theJayTea commentedon Mar 1, 2026
Hi!
As part of a major update, I'm looking to change the hotkey detection system anyway -- its limitations are the biggets gripe I have right now haha.
I'll see if this is something I can easily do with the new library I use for hotkey detection.
And I appriciate how clearly you've had your request explained :)