mirror of
https://github.com/jahruz67/wisp-open.git
synced 2026-08-08 18:14:08 +00:00
6
This commit is contained in:
@@ -132,6 +132,18 @@ func (l *Listener) eventLoop(hk *xhk.Hotkey) {
|
|||||||
logger.Info("Shortcut activated: starting recording")
|
logger.Info("Shortcut activated: starting recording")
|
||||||
go l.startCallback()
|
go l.startCallback()
|
||||||
isRecording = true
|
isRecording = true
|
||||||
|
} else {
|
||||||
|
// We received a second Keydown while already recording.
|
||||||
|
// If Wayland doesn't send Deactivated (Keyup), this acts as a Toggle fallback.
|
||||||
|
select {
|
||||||
|
case <-hk.Keyup():
|
||||||
|
// Out-of-order X11 auto-repeat. Ignore both.
|
||||||
|
case <-time.After(20 * time.Millisecond):
|
||||||
|
// Genuine second press. Toggle off.
|
||||||
|
logger.Info("Shortcut activated again: stopping recording (Wayland toggle fallback)")
|
||||||
|
go l.stopCallback()
|
||||||
|
isRecording = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case _, ok := <-hk.Keyup():
|
case _, ok := <-hk.Keyup():
|
||||||
|
|||||||
Reference in New Issue
Block a user