Closed andyHa closed 6 years ago
This easily trips you up the first time you're using Phoenix, but you're required to save your handlers in a (global) variable, otherwise they will be garbage collected and stop working. If you don't wish to do that, you can use the Key.on
method instead of new Key
.
Awesome - switched to Key.on, works like a charm!
With my current configuration (https://gist.github.com/andyHa/0f7e3ebab503acd70b4fb16e9496ad61)
Everything works a charm (I can move windows across screens and maximize them) and suddently without any log / error / warning - the keybindings stop working (approx 10-20 seconds after loading the config).
I placed logs inside the functions to ensure that there isn't a bug - they arn't called at all. However, I used a timer (1 second interval) which printed a "Hello" - which was still going.
Any hint / reason / workaround, why the keybindings are suddently lost? (BTW - reloading the config "fixes" the problems and the bindings are available for another 20 seconds)...