Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6802 in orxonox.OLD


Ignore:
Timestamp:
Jan 28, 2006, 10:20:47 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: eventHandler releases mouse on alt-Tab, and recaptures it on mouse-click on the Window

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/event/event_handler.cc

    r6771 r6802  
    5252  this->keyMapper = NULL;
    5353  this->stateStack = NULL;
    54 
     54  this->eventsGrabbed = false;
    5555}
    5656
     
    361361int EventHandler::eventFilter(const SDL_Event *event)
    362362{
    363   if (event->type == SDL_KEYDOWN &&  event->key.keysym.sym == SDLK_TAB && SDL_GetKeyState(NULL)[SDLK_LALT])
    364   {
    365     printf("Not sending event to the WindowManager\n");
    366 
    367     EventHandler::getInstance()->grabEvents(false);
    368     return 0;
    369   }
     363  if (likely(EventHandler::getInstance()->eventsGrabbed))
     364  {
     365    if (event->type == SDL_KEYDOWN &&  event->key.keysym.sym == SDLK_TAB && SDL_GetKeyState(NULL)[SDLK_LALT])
     366    {
     367      PRINTF(3)("Not sending event to the WindowManager\n");
     368      EventHandler::getInstance()->grabEvents(false);
     369      return 0;
     370    }
     371  }
     372  else
     373  {
     374    if (event->type == SDL_MOUSEBUTTONDOWN)
     375    {
     376      EventHandler::getInstance()->grabEvents( true);
     377      return 0;
     378    }
     379  }
     380
    370381  return 1;
    371382}
  • trunk/src/subprojects/importer/Makefile.am

    r6676 r6802  
    9494                $(MAINSRCDIR)/lib/parser/ini_parser/ini_parser.cc \
    9595                $(MAINSRCDIR)/lib/coord/p_node.cc \
    96                 $(MAINSRCDIR)/lib/coord/null_parent.cc \
    9796                $(MAINSRCDIR)/util/loading/load_param.cc \
    9897                $(MAINSRCDIR)/util/loading/load_param_description.cc \
Note: See TracChangeset for help on using the changeset viewer.