Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2009, 9:20:57 PM (15 years ago)
Author:
landauf
Message:

merged netp3 branch back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/input/InputManager.cc

    r2896 r3084  
    4141#include "ois/OISException.h"
    4242#include "ois/OISInputManager.h"
     43#include "core/ConsoleCommand.h"
     44
     45// HACK
     46#ifdef ORXONOX_PLATFORM_LINUX
     47#  include "ois/linux/LinuxMouse.h"
     48#endif
    4349
    4450#include "util/Exception.h"
     
    4753#include "core/ConfigValueIncludes.h"
    4854#include "core/CommandExecutor.h"
    49 #include "core/ConsoleCommand.h"
    5055#include "core/CommandLine.h"
    5156#include "util/Debug.h"
     
    6469    SetConsoleCommand(InputManager, calibrate, true);
    6570    SetConsoleCommand(InputManager, reload, false);
     71#ifdef ORXONOX_PLATFORM_LINUX
     72    SetConsoleCommand(InputManager, grabMouse, true);
     73    SetConsoleCommand(InputManager, ungrabMouse, true);
     74#endif
    6675    SetCommandLineSwitch(keyboard_no_grab);
    6776
     
    14691478        getInstance().reloadInputSystem(joyStickSupport);
    14701479    }
     1480
     1481
     1482    // ############################################################
     1483    // #####                   ugly hacks                     #####
     1484    // ##########                                        ##########
     1485    // ############################################################
     1486
     1487#ifdef ORXONOX_PLATFORM_LINUX
     1488    void InputManager::grabMouse()
     1489    {
     1490        OIS::LinuxMouse* linuxMouse = dynamic_cast<OIS::LinuxMouse*>(singletonRef_s->mouse_);
     1491        assert(linuxMouse);
     1492        linuxMouse->grab(true);
     1493    }
     1494
     1495    void InputManager::ungrabMouse()
     1496    {
     1497        OIS::LinuxMouse* linuxMouse = dynamic_cast<OIS::LinuxMouse*>(singletonRef_s->mouse_);
     1498        assert(linuxMouse);
     1499        linuxMouse->grab(false);
     1500    }
     1501#endif
    14711502}
Note: See TracChangeset for help on using the changeset viewer.