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
The Linux C code event loop only returns after the hotkey was pressed. The hotkey can not be canceled while waitHotkey waits for a new hotkey. hk.Unregister() can be successfully called, but the hotkey is only unregistered after it was triggered.
Steps to reproduce
Register a simple hotkey on Linux
Unregister the hotkey
Notes
hk:=h.New([]h.Modifier{h.ModCtrl}, h.KeyM)
hk.Register()
gofunc() {
time.Sleep(time.Second*1)
fmt.Println("Hotkey will be unregistered")
hk.Unregister()
fmt.Println("Hotkey unregistered")
hk.Register()
fmt.Println("Registered again")
}()
<-hk.Keydown()
This code blocks. I would expect the chan to be closed and the program to exit.
I would expect that the above loop checks, if the hotkey was unregistered. XNextEvent also blocks until the next event, but that should be fine as long as a lot of events are triggered. Else something like XPending could be used to check, if new events can be processed.
The text was updated successfully, but these errors were encountered:
Description
The Linux C code event loop only returns after the hotkey was pressed. The hotkey can not be canceled while
waitHotkey
waits for a new hotkey.hk.Unregister()
can be successfully called, but the hotkey is only unregistered after it was triggered.Steps to reproduce
Notes
This code blocks. I would expect the
chan
to be closed and the program to exit.hotkey/hotkey_linux.c
Lines 64 to 77 in a5dde31
I would expect that the above loop checks, if the hotkey was unregistered.
XNextEvent
also blocks until the next event, but that should be fine as long as a lot of events are triggered. Else something likeXPending
could be used to check, if new events can be processed.The text was updated successfully, but these errors were encountered: