int DesktopWindow::handle(int event)
{
int buttonMask, wheelMask;
+ DownMap::const_iterator iter;
switch (event) {
case FL_PUSH:
// Yes, we would like some focus please!
return 1;
+ case FL_UNFOCUS:
+ // Release all keys that were pressed as that generally makes most
+ // sense (e.g. Alt+Tab where we only see the Alt press)
+ for (iter = downKeySym.begin();iter != downKeySym.end();++iter)
+ cc->writer()->keyEvent(iter->second, false);
+ downKeySym.clear();
+ return 1;
+
case FL_KEYDOWN:
handleKeyEvent(Fl::event_key(), Fl::event_compose_symbol(), true);
return 1;