Hm, this approach isn't going to work when other parts of Mixxx pop a dialog and it will be a big pain to connect them all back to MixxxKeyboard like we did w/ preferences here.

Instead, we could probably listen to focus events in the event filter. The focus event reason has options for "window lost focus" and "modal popup stole focus". In those cases, we could clear the active key list and deliver release events for every CO.