Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 24, 2009, 10:10:05 AM (15 years ago)
Author:
rgrieder
Message:

Non exclusive input should theoretically work too on Linux now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource2/src/core/input/InputManager.cc

    r5670 r5671  
    167167        OIS::ParamList paramList;
    168168        size_t windowHnd = GraphicsManager::getInstance().getRenderWindowHandle();
    169         paramList.insert(std::make_pair(std::string("WINDOW"), multi_cast<std::string>(windowHnd)));
     169        paramList.insert(std::make_pair("WINDOW", multi_cast<std::string>(windowHnd)));
    170170#if defined(ORXONOX_PLATFORM_WINDOWS)
    171         // Load in non exclusive mode and change later
     171        paramList.insert(std::make_pair("w32_keyboard", "DISCL_NONEXCLUSIVE"));
     172        paramList.insert(std::make_pair("w32_keyboard", "DISCL_FOREGROUND"));
     173        paramList.insert(std::make_pair("w32_mouse", "DISCL_FOREGROUND"));
    172174        if (bExclusiveMouse_ || GraphicsManager::getInstance().isFullScreen())
    173             paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_EXCLUSIVE")));
     175        {
     176            // Disable Windows key plus special keys (like play, stop, next, etc.)
     177            paramList.insert(std::make_pair("w32_keyboard", "DISCL_NOWINKEY"));
     178            paramList.insert(std::make_pair("w32_mouse", "DISCL_EXCLUSIVE"));
     179        }
    174180        else
    175             paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
    176         paramList.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND")));
     181            paramList.insert(std::make_pair("w32_mouse", "DISCL_NONEXCLUSIVE"));
    177182#elif defined(ORXONOX_PLATFORM_LINUX)
    178         paramList.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
    179         paramList.insert(std::make_pair(std::string("x11_mouse_grab"), "true"));
    180         paramList.insert(std::make_pair(std::string("x11_mouse_hide"), "true"));
    181         bool kbNoGrab;
    182         CommandLine::getValue("keyboard_no_grab", &kbNoGrab);
    183         if (kbNoGrab)
    184             paramList.insert(std::make_pair(std::string("x11_keyboard_grab"), std::string("false")));
     183        // Enabling this is probably a bad idea, but whenever orxonox crashes, the setting stays on
     184        // Trouble might be that the Pressed event occurs a bit too often...
     185        paramList.insert(std::make_pair("XAutoRepeatOn", "true"));
     186
     187        if (bExclusiveMouse_ || GraphicsManager::getInstance().isFullScreen())
     188        {
     189            if (CommandLine::getValue("keyboard_no_grab").getBool())
     190                paramList.insert(std::make_pair("x11_keyboard_grab", "false"));
     191            else
     192                paramList.insert(std::make_pair("x11_keyboard_grab", "true"));
     193            paramList.insert(std::make_pair("x11_mouse_grab",  "true"));
     194            paramList.insert(std::make_pair("x11_mouse_hide", "true"));
     195        }
    185196        else
    186             paramList.insert(std::make_pair(std::string("x11_keyboard_grab"), std::string("true")));
     197        {
     198            paramList.insert(std::make_pair("x11_keyboard_grab", "false"));
     199            paramList.insert(std::make_pair("x11_mouse_grab",  "false"));
     200            paramList.insert(std::make_pair("x11_mouse_hide", "false"));
     201        }
    187202#endif
    188203
Note: See TracChangeset for help on using the changeset viewer.