コード例 #1
0
ファイル: testApp.cpp プロジェクト: strimbob/ofxQuad
//--------------------------------------------------------------
void testApp::setup(){
    CGDisplayShowCursor(kCGDirectMainDisplay);
//  CGDisplayHideCursor(kCGDirectMainDisplay);
    swapGloble = 0;
    dir.listDir("videos");
	dir.sort();
    ofSetVerticalSync(true);
    hozpertion = 1;
    load = 0;
    ofEnableSmoothing();
    maxNumber = (int)dir.size();
    mapping =    new ofxQuad*[20];
    width  = 10;
    height = 10;
    for(int i = 0; i < maxNumber; i++){
        mapping[i] = new ofxQuad();
        vid.push_back(ofVideoPlayer());
        vid[i].loadMovie(dir.getPath(i));
       // vid[i].setPixelFormat(ofPixelFormat _rg)
        mapping[i]->setup(width+10,10, 200, 200, ofGetWidth(), ofGetHeight(),i);
        mapping[0]->activate();
        width = vid[i].getWidth() * (1 + i);
        height = 10;
        vid[i].play();
        mapping[i]->debugSet(0);
    }
    h = ofGetHeight();
    w = ofGetWidth();
    loadMe();
}
コード例 #2
0
ファイル: COSXScreen.cpp プロジェクト: rakete/synergy-foss
void
COSXScreen::showCursor()
{
	LOG((CLOG_DEBUG "showing cursor"));

	CFStringRef propertyString = CFStringCreateWithCString(
		NULL, "SetsCursorInBackground", kCFStringEncodingMacRoman);

	CGSSetConnectionProperty(
		_CGSDefaultConnection(), _CGSDefaultConnection(),
		propertyString, kCFBooleanTrue);

	CFRelease(propertyString);

	CGError error = CGDisplayShowCursor(m_displayID);
	if (error != kCGErrorSuccess) {
		LOG((CLOG_ERR "failed to show cursor, error=%d", error));
	}

	// appears to fix "mouse randomly not showing" bug
	CGAssociateMouseAndMouseCursorPosition(true);

	if (!CGCursorIsVisible()) {
		LOG((CLOG_WARN "cursor may not be visible"));
	}

	m_cursorHidden = false;
}
コード例 #3
0
ファイル: org_lwjgl_input_Mouse.c プロジェクト: rgarat/lwjgl
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_nGrabMouse(JNIEnv *env, jclass unused, jboolean grab) {
    CGAssociateMouseAndMouseCursorPosition(grab == JNI_TRUE ? FALSE : TRUE);
    if (grab)
        CGDisplayHideCursor(kCGDirectMainDisplay);
    else
        CGDisplayShowCursor(kCGDirectMainDisplay);
}
コード例 #4
0
ファイル: ofxTouchAppRunner.cpp プロジェクト: 6301158/ofx-dev
//--------------------------------------
void ofShowCursor(){
	#ifdef TARGET_OSX
		CGDisplayShowCursor(kCGDirectMainDisplay);
	#else 
		glutSetCursor(GLUT_CURSOR_LEFT_ARROW);
	#endif
}
コード例 #5
0
//------------------------------------------------------------
void ofAppGlutWindow::showCursor(){
	#if defined(TARGET_OSX) && defined(MAC_OS_X_VERSION_10_7)
		 CGDisplayShowCursor(NULL);
	#else
		glutSetCursor(GLUT_CURSOR_LEFT_ARROW);
	#endif
}
コード例 #6
0
ファイル: input.cpp プロジェクト: mmozeiko/Squares3D
void Input::mouseVisible(bool visible)
{
    if (visible)
    {
#ifdef __APPLE__
    	CGAssociateMouseAndMouseCursorPosition(TRUE);
	    CGDisplayShowCursor(kCGDirectMainDisplay);
#else
        glfwEnable(GLFW_MOUSE_CURSOR);
        glfwSetMousePos(m_mouseMiddleX, m_mouseMiddleY);
#endif
    }
    else
    {
#ifdef __APPLE__
	    glfwSetMousePos(m_mouseMiddleX, m_mouseMiddleY);
        CGDisplayHideCursor(kCGDirectMainDisplay);
	    CGPoint p;
	    p.x = m_mouseMiddleX;
	    p.y = m_mouseMiddleY;
	    //CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, p);
	    CGWarpMouseCursorPosition(p);
	    CGAssociateMouseAndMouseCursorPosition(FALSE);
#else
        glfwDisable(GLFW_MOUSE_CURSOR);
        glfwSetMousePos(m_mouseMiddleX, m_mouseMiddleY);
#endif
    }
    m_mouseVisible = visible;
}
コード例 #7
0
void
COSXScreen::showCursor()
{
    CGDisplayShowCursor(m_displayID);
    CFStringRef propertyString = CFStringCreateWithCString(NULL, "SetsCursorInBackground", kCFStringEncodingMacRoman);
    CGSSetConnectionProperty(_CGSDefaultConnection(), _CGSDefaultConnection(), propertyString, kCFBooleanFalse);
    CFRelease(propertyString);
	
    LOG((CLOG_DEBUG "Trying to show cursor."));
}
コード例 #8
0
void inputMouseUp(InputContext* ctx, int x, int y) {
  CGDisplayShowCursor(kCGDirectMainDisplay);
  CGEventRef mouseUp = CGEventCreateMouseEvent(
      NULL, kCGEventLeftMouseUp,
      CGPointMake(x, y),
      kCGMouseButtonLeft
  );

  CGEventPost(kCGHIDEventTap, mouseUp);
  CFRelease(mouseUp);
}
コード例 #9
0
//--------------------------------------------------------------
void testApp::drawDebug(){
    //show cursor
    CGDisplayShowCursor(NULL);
    
    //draw some debug shit on screen
    ofDrawBitmapString("frame: " + ofToString(player.getCurrentFrame()) + "/"+ofToString(player.getTotalNumFrames()),50,50);
    ofDrawBitmapString("position: " + ofToString(player.getPosition()),50,70);
    ofDrawBitmapString("iPhone IP: " + iPhoneIP,50,90);
    ofDrawBitmapString("OSX Client IP: "+ osxIP, 50,110);
    ofDrawBitmapString("iPad IP: " + iPadIP ,50,130);
    ofDrawBitmapString("Currently playing: " + player.getMoviePath() ,50,150);
    ofDrawBitmapString("Sending OSC?: " + ofToString(sendOSC) ,50,170);
    ofDrawBitmapString(ss.str(), ofGetWidth()/2, 50); // draw json on right side of screen
}
コード例 #10
0
ファイル: cyrilApp.cpp プロジェクト: radiodario/cyril
void cyrilApp::toggleFullscreen(void * _o) {
  ((cyrilApp *)_o)->isFullScreen = !((cyrilApp *)_o)->isFullScreen;
  ofSetFullscreen(((cyrilApp *)_o)->isFullScreen);
  
  if (((cyrilApp *)_o)->isFullScreen) {
    ofHideCursor();
#ifdef __APPLE__
    CGDisplayHideCursor(NULL); 
#endif
  }
  else {
    ofShowCursor();
#ifdef __APPLE__
    CGDisplayShowCursor(NULL);
#endif
  }
}
コード例 #11
0
void FOutputDeviceMacError::HandleError()
{
	// make sure we don't report errors twice
	static int32 CallCount = 0;
	int32 NewCallCount = FPlatformAtomics::InterlockedIncrement(&CallCount);
	if (NewCallCount != 1)
	{
		UE_LOG(LogMac, Error, TEXT("HandleError re-entered.") );
		return;
	}

	// Trigger the OnSystemFailure hook if it exists
	FCoreDelegates::OnHandleSystemError.Broadcast();

	try
	{
		GIsGuarded				= 0;
		GIsRunning				= 0;
		GIsCriticalError		= 1;
		GLogConsole				= NULL;
		GErrorHist[ARRAY_COUNT(GErrorHist)-1]=0;

		// Dump the error and flush the log.
		UE_LOG(LogMac, Log, TEXT("=== Critical error: ===") LINE_TERMINATOR TEXT("%s") LINE_TERMINATOR, GErrorExceptionDescription);
		UE_LOG(LogMac, Log, GErrorHist);

		GLog->Flush();

		// Unhide the mouse.
		while (!CGCursorIsVisible())
		{
			CGDisplayShowCursor(kCGDirectMainDisplay);
		}
		// Release capture and allow mouse to freely roam around.
		CGAssociateMouseAndMouseCursorPosition(true);

		FPlatformMisc::ClipboardCopy(GErrorHist);

		FPlatformMisc::SubmitErrorReport( GErrorHist, EErrorReportMode::Interactive );

		FCoreDelegates::OnShutdownAfterError.Broadcast();
	}
	catch( ... )
	{}
}
コード例 #12
0
void BaseApp::captureMouse(const bool value){
#ifndef NO_CAPTURE_MOUSE
	if (mouseCaptured != value){
		//static int mouseX, mouseY;
		if (value){
			CGDisplayHideCursor(kCGDirectMainDisplay);

			setCursorPos(width / 2, height / 2);
		} else {
			CGDisplayShowCursor(kCGDirectMainDisplay);

			// TODO: Fix ...
			//setCursorPos(mouseX, mouseY);
		}
		CGAssociateMouseAndMouseCursorPosition(mouseCaptured);

		mouseCaptured = value;
	}
#endif
}
コード例 #13
0
//--------------------------------------------------------------
void testApp::keyPressed(int key){
    // hide gui
    if( key == 'h' ){
		bHide = !bHide;
        
        if(bHide){
            // ofHideCursor();
            CGDisplayHideCursor(NULL);
        }else{
            //  ofShowCursor();
            CGDisplayShowCursor(NULL);
        }
	}
    
    // save current settings
	if(key == 's') {
		gui.saveToFile("settings.xml");
	}
    
    // load settings from file / reset to default values
	if(key == 'l') {
		gui.loadFromFile("settings.xml");
	}
}
コード例 #14
0
FREObject showMouse(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])
{
    CGDisplayShowCursor (kCGDirectMainDisplay);
    return NULL;
}
コード例 #15
0
JNIEXPORT void JNICALL Java_com_intellij_util_ui_MacUIUtil_doShowCursor
  (JNIEnv *env, jclass clazz) {
  CGDisplayShowCursor(kCGDirectMainDisplay);
}
コード例 #16
0
//default mouse event handler
static OSStatus MouseEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData)
{
    OSStatus result = noErr;
	UInt32 class = GetEventClass (event);
	UInt32 kind = GetEventKind (event); 

	result = CallNextEventHandler(nextHandler, event);
	
	if(class == kEventClassMouse)
	{
		WindowPtr tmpWin;
		Point mousePos;
		Point winMousePos;

		GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, 0, sizeof(Point), 0, &mousePos);
		GetEventParameter(event, kEventParamWindowMouseLocation, typeQDPoint, 0, sizeof(Point), 0, &winMousePos);

		switch (kind)
		{
			case kEventMouseMoved:
			{
				if(vo_quartz_fs)
				{
					CGDisplayShowCursor(kCGDirectMainDisplay);
					mouseHide = FALSE;
				}
			}
			break;
			
			case kEventMouseWheelMoved:
			{
				int wheel;
				short part;
				
				GetEventParameter(event, kEventParamMouseWheelDelta, typeSInt32, 0, sizeof(int), 0, &wheel);

				part = FindWindow(mousePos,&tmpWin);
				
				if(part == inContent)
				{
					if(wheel > 0)
						mplayer_put_key(MOUSE_BTN3);
					else
						mplayer_put_key(MOUSE_BTN4);
				}
			}
			break;
			
			case kEventMouseDown:
			{
				EventMouseButton button;
				short part;
				Rect bounds;
				
				GetWindowPortBounds(theWindow, &bounds);
				GetEventParameter(event, kEventParamMouseButton, typeMouseButton, 0, sizeof(EventMouseButton), 0, &button);
				
				part = FindWindow(mousePos,&tmpWin);
				
				if( (winMousePos.h > (bounds.right - 15)) && (winMousePos.v > (bounds.bottom)) )
				{
					if(!vo_quartz_fs)
					{
						GrowWindow(theWindow, mousePos, NULL);
					}
				}
				else if(part == inMenuBar)
				{
					MenuSelect(mousePos);
					HiliteMenu(0);
				}
				else if(part == inContent)
				{
					switch(button)
					{ 
						case 1: mplayer_put_key(MOUSE_BTN0);break;
						case 2: mplayer_put_key(MOUSE_BTN2);break;
						case 3: mplayer_put_key(MOUSE_BTN1);break;
				
						default:result = eventNotHandledErr;break;
					}
				}
			}		
			break;
			
			case kEventMouseUp:
			break;
			
			case kEventMouseDragged:
			break;
				
			default:result = eventNotHandledErr;break;
		}
	}

    return result;
}
コード例 #17
0
ファイル: vid_agl.c プロジェクト: Blub/darkplaces
void VID_SetMouse(qboolean fullscreengrab, qboolean relative, qboolean hidecursor)
{
	if (!mouse_avail || !window)
		relative = hidecursor = false;

	if (relative)
	{
		if(vid_usingmouse && (vid_usingnoaccel != !!apple_mouse_noaccel.integer))
			VID_SetMouse(false, false, false); // ungrab first!
		if (!vid_usingmouse)
		{
			Rect winBounds;
			CGPoint winCenter;

			SelectWindow(window);

			// Put the mouse cursor at the center of the window
			GetWindowBounds (window, kWindowContentRgn, &winBounds);
			winCenter.x = (winBounds.left + winBounds.right) / 2;
			winCenter.y = (winBounds.top + winBounds.bottom) / 2;
			CGWarpMouseCursorPosition(winCenter);

			// Lock the mouse pointer at its current position
			CGAssociateMouseAndMouseCursorPosition(false);

			// Save the status of mouse acceleration
			originalMouseSpeed = -1.0; // in case of error
			if(apple_mouse_noaccel.integer)
			{
				io_connect_t mouseDev = IN_GetIOHandle();
				if(mouseDev != 0)
				{
					if(IOHIDGetAccelerationWithKey(mouseDev, CFSTR(kIOHIDMouseAccelerationType), &originalMouseSpeed) == kIOReturnSuccess)
					{
						Con_DPrintf("previous mouse acceleration: %f\n", originalMouseSpeed);
						if(IOHIDSetAccelerationWithKey(mouseDev, CFSTR(kIOHIDMouseAccelerationType), -1.0) != kIOReturnSuccess)
						{
							Con_Print("Could not disable mouse acceleration (failed at IOHIDSetAccelerationWithKey).\n");
							Cvar_SetValueQuick(&apple_mouse_noaccel, 0);
						}
					}
					else
					{
						Con_Print("Could not disable mouse acceleration (failed at IOHIDGetAccelerationWithKey).\n");
						Cvar_SetValueQuick(&apple_mouse_noaccel, 0);
					}
					IOServiceClose(mouseDev);
				}
				else
				{
					Con_Print("Could not disable mouse acceleration (failed at IO_GetIOHandle).\n");
					Cvar_SetValueQuick(&apple_mouse_noaccel, 0);
				}
			}

			vid_usingmouse = true;
			vid_usingnoaccel = !!apple_mouse_noaccel.integer;
		}
	}
	else
	{
		if (vid_usingmouse)
		{
			if(originalMouseSpeed != -1.0)
			{
				io_connect_t mouseDev = IN_GetIOHandle();
				if(mouseDev != 0)
				{
					Con_DPrintf("restoring mouse acceleration to: %f\n", originalMouseSpeed);
					if(IOHIDSetAccelerationWithKey(mouseDev, CFSTR(kIOHIDMouseAccelerationType), originalMouseSpeed) != kIOReturnSuccess)
						Con_Print("Could not re-enable mouse acceleration (failed at IOHIDSetAccelerationWithKey).\n");
					IOServiceClose(mouseDev);
				}
				else
					Con_Print("Could not re-enable mouse acceleration (failed at IO_GetIOHandle).\n");
			}

			CGAssociateMouseAndMouseCursorPosition(true);

			vid_usingmouse = false;
		}
	}

	if (vid_usinghidecursor != hidecursor)
	{
		vid_usinghidecursor = hidecursor;
		if (hidecursor)
			CGDisplayHideCursor(CGMainDisplayID());
		else
			CGDisplayShowCursor(CGMainDisplayID());
	}
}
コード例 #18
0
ファイル: macosx_window.c プロジェクト: x-y-z/SteerSuite-CUDA
void _glfwPlatformShowMouseCursor( void )
{
    // TO DO: What if we fail here?
    CGDisplayShowCursor( kCGDirectMainDisplay );
    CGAssociateMouseAndMouseCursorPosition( true );
}
コード例 #19
0
ファイル: macosx_window.c プロジェクト: mikanradojevic/sdkpub
void _glfwPlatformShowMouseCursor( void )
{
    // TO DO: What if we fail here?
    (void)CGDisplayShowCursor( kCGDirectMainDisplay );
}
コード例 #20
0
void
InputManager::init(size_t p_windowHandle, uint p_width, uint p_height)
{
    std::ostringstream windowHndStr;
    windowHndStr << p_windowHandle;

    OIS::ParamList paramList;
    paramList.insert(std::make_pair(
            std::string("WINDOW"), 
            windowHndStr.str()));

#if defined OIS_WIN32_PLATFORM
    paramList.insert(std::make_pair(
            std::string("w32_mouse"), 
            std::string("DISCL_FOREGROUND" )));
    paramList.insert(std::make_pair(
            std::string("w32_mouse"), 
            std::string("DISCL_NONEXCLUSIVE")));
    paramList.insert(std::make_pair(
            std::string("w32_keyboard"), 
            std::string("DISCL_FOREGROUND")));
    paramList.insert(std::make_pair(
            std::string("w32_keyboard"), 
            std::string("DISCL_NONEXCLUSIVE")));
#elif defined OIS_LINUX_PLATFORM
    paramList.insert(std::make_pair(
            std::string("x11_mouse_grab"), 
            std::string("false")));
    paramList.insert(std::make_pair(
            std::string("x11_mouse_hide"), 
            std::string("false")));
    paramList.insert(std::make_pair(
            std::string("x11_keyboard_grab"), 
            std::string("false")));
    paramList.insert(std::make_pair(
            std::string("XAutoRepeatOn"), 
            std::string("true")));
#elif defined OIS_APPLE_PLATFORM

#endif

    /// @todo TODO: disable key repeat on all platforms

    m_inputManager = OIS::InputManager::createInputSystem(paramList);

    m_keyboard = static_cast<OIS::Keyboard*>(
            m_inputManager->createInputObject(OIS::OISKeyboard, true));
            
    m_keyboard->setEventCallback(this);

    m_mouse = static_cast<OIS::Mouse*>(
        m_inputManager->createInputObject(OIS::OISMouse, true));

    m_mouse->setEventCallback(this);

    const OIS::MouseState& ms = m_mouse->getMouseState();
    ms.width = p_width;
    ms.height = p_height;

#ifdef __MAC__
    CGAssociateMouseAndMouseCursorPosition(TRUE);
    CGDisplayShowCursor(kCGDirectMainDisplay);
#endif

    try 
    {
        m_joystick = static_cast<OIS::JoyStick*>(
                m_inputManager->createInputObject(OIS::OISJoyStick, false));
    }
    catch(...) 
    {
        m_joystick = 0;
    }

    if(m_joystick)
        m_joystick->setEventCallback(this);

    m_initialized = true;
}
コード例 #21
0
ファイル: carbon_window.c プロジェクト: chrisinajar/node-ogl
void _glfwPlatformShowMouseCursor( void )
{
    CGDisplayShowCursor( kCGDirectMainDisplay );
    CGAssociateMouseAndMouseCursorPosition( true );
}
コード例 #22
0
OP_STATUS MacOpPluginAdapter::ProcessMessage(const OpTypedMessage* message)
{
	switch (message->GetType())
	{
		case OpPeerConnectedMessage::Type:
			if (m_plugin_window)
				// Send initial top-level window coordinates.
				m_plugin_window->OnDesktopWindowMoved(NULL);
			break;
			
		case OpPeerDisconnectedMessage::Type:
			m_plugin_channel = NULL;
			break;
			
		case OpMacPluginUpdateViewMessage::Type:
			if (m_plugin_window)
				m_plugin_window->UpdatePluginView();
			break;
			
		case OpMacPluginFullscreenMessage::Type:
		{
			SystemUIMode outMode;
			SystemUIOptions  outOptions;
			GetSystemUIMode(&outMode, &outOptions);
			
			ProcessSerialNumber psn;
			
			if (OpMacPluginFullscreenMessage::Cast(message)->GetFullscreen())
			{
				// Hide menu and dock
				SetSystemUIMode(kUIModeAllHidden, outOptions);
				
				// Set the plugin as the front process
				psn.highLongOfPSN = OpMacPluginFullscreenMessage::Cast(message)->GetHighLongOfPSN();
				psn.lowLongOfPSN = OpMacPluginFullscreenMessage::Cast(message)->GetLowLongOfPSN();
				SetFrontProcess(&psn);
			}
			else
			{
				// Set Opera as the front process
				GetCurrentProcess(&psn);
				SetFrontProcess(&psn);
				
				// Show menu and dock
				SetSystemUIMode(kUIModeNormal, outOptions);
			}
		}
			break;
			
		case OpMacPluginWindowShownMessage::Type:
		{
			ProcessSerialNumber psn;
			
			if (OpMacPluginWindowShownMessage::Cast(message)->GetShow())
			{
				// Set the plugin as the front process
				psn.highLongOfPSN = OpMacPluginWindowShownMessage::Cast(message)->GetHighLongOfPSN();
				psn.lowLongOfPSN = OpMacPluginWindowShownMessage::Cast(message)->GetLowLongOfPSN();
				SetFrontProcess(&psn);
			}
			else
			{
				// Set Opera as the front process
				GetCurrentProcess(&psn);
				SetFrontProcess(&psn);
			}
		}
			break;
			
		case OpMacPluginInfoMessage::Type:
			return message->Reply(OpMacPluginInfoResponseMessage::Create(CommandLineManager::GetInstance()->GetArgument(CommandLineManager::DisableCoreAnimation) ? TRUE : FALSE,
																		 CommandLineManager::GetInstance()->GetArgument(CommandLineManager::DisableInvalidatingCoreAnimation) ? TRUE : FALSE));

		case OpMacPluginCursorShownMessage::Type:
		{
			if (OpMacPluginCursorShownMessage::Cast(message)->GetShow())
			{
				CGDisplayShowCursor(CGMainDisplayID());
			}
			else
			{
				CGDisplayHideCursor(CGMainDisplayID());
			}
		}
			break;

		case OpMacPluginContextMenuShownMessage::Type:
		{
			gHandlingContextMenu = OpMacPluginContextMenuShownMessage::Cast(message)->GetShow();
		}
			break;
	}
	
	return OpStatus::OK;
}
コード例 #23
0
ファイル: OisInputListener.cpp プロジェクト: gsage/engine
  OisInputListener::OisInputListener(size_t handle, Engine* eventRedirect) :
    InputHandler(handle, eventRedirect),
    mMouse(0),
    mKeyboard(0),
    mInputManager(0),
    mEventRedirect(eventRedirect),
    mHandle(handle)
  {
    LOG(INFO) << "*** Initializing OIS ***";
    OIS::ParamList pl;
    std::ostringstream windowHndStr;

    windowHndStr << handle;
    pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
#if defined OIS_WIN32_PLATFORM
    pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND" )));
    pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
    pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND")));
    pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE")));
#elif defined OIS_LINUX_PLATFORM
    pl.insert(std::make_pair(std::string("x11_mouse_grab"), std::string("false")));
    pl.insert(std::make_pair(std::string("x11_mouse_hide"), std::string("true")));
    pl.insert(std::make_pair(std::string("x11_keyboard_grab"), std::string("false")));
    pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
#endif

#ifdef OIS_APPLE_PLATFORM
    CGDisplayShowCursor(kCGDirectMainDisplay);
    CGAssociateMouseAndMouseCursorPosition(TRUE);
#endif

    mInputManager = OIS::InputManager::createInputSystem( pl );
    mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
    mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));

    mMouse->setEventCallback(this);
    mKeyboard->setEventCallback(this);

    mKeyMap[OIS::KC_UNASSIGNED] = KeyboardEvent::KC_UNASSIGNED;
    mKeyMap[OIS::KC_ESCAPE] = KeyboardEvent::KC_ESCAPE;
    mKeyMap[OIS::KC_1] = KeyboardEvent::KC_1;
    mKeyMap[OIS::KC_2] = KeyboardEvent::KC_2;
    mKeyMap[OIS::KC_3] = KeyboardEvent::KC_3;
    mKeyMap[OIS::KC_4] = KeyboardEvent::KC_4;
    mKeyMap[OIS::KC_5] = KeyboardEvent::KC_5;
    mKeyMap[OIS::KC_6] = KeyboardEvent::KC_6;
    mKeyMap[OIS::KC_7] = KeyboardEvent::KC_7;
    mKeyMap[OIS::KC_8] = KeyboardEvent::KC_8;
    mKeyMap[OIS::KC_9] = KeyboardEvent::KC_9;
    mKeyMap[OIS::KC_0] = KeyboardEvent::KC_0;
    mKeyMap[OIS::KC_MINUS] = KeyboardEvent::KC_MINUS;
    mKeyMap[OIS::KC_EQUALS] = KeyboardEvent::KC_EQUALS;
    mKeyMap[OIS::KC_BACK] = KeyboardEvent::KC_BACK;
    mKeyMap[OIS::KC_TAB] = KeyboardEvent::KC_TAB;
    mKeyMap[OIS::KC_Q] = KeyboardEvent::KC_Q;
    mKeyMap[OIS::KC_W] = KeyboardEvent::KC_W;
    mKeyMap[OIS::KC_E] = KeyboardEvent::KC_E;
    mKeyMap[OIS::KC_R] = KeyboardEvent::KC_R;
    mKeyMap[OIS::KC_T] = KeyboardEvent::KC_T;
    mKeyMap[OIS::KC_Y] = KeyboardEvent::KC_Y;
    mKeyMap[OIS::KC_U] = KeyboardEvent::KC_U;
    mKeyMap[OIS::KC_I] = KeyboardEvent::KC_I;
    mKeyMap[OIS::KC_O] = KeyboardEvent::KC_O;
    mKeyMap[OIS::KC_P] = KeyboardEvent::KC_P;
    mKeyMap[OIS::KC_LBRACKET] = KeyboardEvent::KC_LBRACKET;
    mKeyMap[OIS::KC_RBRACKET] = KeyboardEvent::KC_RBRACKET;
    mKeyMap[OIS::KC_RETURN] = KeyboardEvent::KC_RETURN;
    mKeyMap[OIS::KC_LCONTROL] = KeyboardEvent::KC_LCONTROL;
    mKeyMap[OIS::KC_A] = KeyboardEvent::KC_A;
    mKeyMap[OIS::KC_S] = KeyboardEvent::KC_S;
    mKeyMap[OIS::KC_D] = KeyboardEvent::KC_D;
    mKeyMap[OIS::KC_F] = KeyboardEvent::KC_F;
    mKeyMap[OIS::KC_G] = KeyboardEvent::KC_G;
    mKeyMap[OIS::KC_H] = KeyboardEvent::KC_H;
    mKeyMap[OIS::KC_J] = KeyboardEvent::KC_J;
    mKeyMap[OIS::KC_K] = KeyboardEvent::KC_K;
    mKeyMap[OIS::KC_L] = KeyboardEvent::KC_L;
    mKeyMap[OIS::KC_SEMICOLON] = KeyboardEvent::KC_SEMICOLON;
    mKeyMap[OIS::KC_APOSTROPHE] = KeyboardEvent::KC_APOSTROPHE;
    mKeyMap[OIS::KC_GRAVE] = KeyboardEvent::KC_GRAVE;
    mKeyMap[OIS::KC_LSHIFT] = KeyboardEvent::KC_LSHIFT;
    mKeyMap[OIS::KC_BACKSLASH] = KeyboardEvent::KC_BACKSLASH;
    mKeyMap[OIS::KC_Z] = KeyboardEvent::KC_Z;
    mKeyMap[OIS::KC_X] = KeyboardEvent::KC_X;
    mKeyMap[OIS::KC_C] = KeyboardEvent::KC_C;
    mKeyMap[OIS::KC_V] = KeyboardEvent::KC_V;
    mKeyMap[OIS::KC_B] = KeyboardEvent::KC_B;
    mKeyMap[OIS::KC_N] = KeyboardEvent::KC_N;
    mKeyMap[OIS::KC_M] = KeyboardEvent::KC_M;
    mKeyMap[OIS::KC_COMMA] = KeyboardEvent::KC_COMMA;
    mKeyMap[OIS::KC_PERIOD] = KeyboardEvent::KC_PERIOD;
    mKeyMap[OIS::KC_SLASH] = KeyboardEvent::KC_SLASH;
    mKeyMap[OIS::KC_RSHIFT] = KeyboardEvent::KC_RSHIFT;
    mKeyMap[OIS::KC_MULTIPLY] = KeyboardEvent::KC_MULTIPLY;
    mKeyMap[OIS::KC_LMENU] = KeyboardEvent::KC_LMENU;
    mKeyMap[OIS::KC_SPACE] = KeyboardEvent::KC_SPACE;
    mKeyMap[OIS::KC_CAPITAL] = KeyboardEvent::KC_CAPITAL;
    mKeyMap[OIS::KC_F1] = KeyboardEvent::KC_F1;
    mKeyMap[OIS::KC_F2] = KeyboardEvent::KC_F2;
    mKeyMap[OIS::KC_F3] = KeyboardEvent::KC_F3;
    mKeyMap[OIS::KC_F4] = KeyboardEvent::KC_F4;
    mKeyMap[OIS::KC_F5] = KeyboardEvent::KC_F5;
    mKeyMap[OIS::KC_F6] = KeyboardEvent::KC_F6;
    mKeyMap[OIS::KC_F7] = KeyboardEvent::KC_F7;
    mKeyMap[OIS::KC_F8] = KeyboardEvent::KC_F8;
    mKeyMap[OIS::KC_F9] = KeyboardEvent::KC_F9;
    mKeyMap[OIS::KC_F10] = KeyboardEvent::KC_F10;
    mKeyMap[OIS::KC_NUMLOCK] = KeyboardEvent::KC_NUMLOCK;
    mKeyMap[OIS::KC_SCROLL] = KeyboardEvent::KC_SCROLL;
    mKeyMap[OIS::KC_NUMPAD7] = KeyboardEvent::KC_NUMPAD7;
    mKeyMap[OIS::KC_NUMPAD8] = KeyboardEvent::KC_NUMPAD8;
    mKeyMap[OIS::KC_NUMPAD9] = KeyboardEvent::KC_NUMPAD9;
    mKeyMap[OIS::KC_SUBTRACT] = KeyboardEvent::KC_SUBTRACT;
    mKeyMap[OIS::KC_NUMPAD4] = KeyboardEvent::KC_NUMPAD4;
    mKeyMap[OIS::KC_NUMPAD5] = KeyboardEvent::KC_NUMPAD5;
    mKeyMap[OIS::KC_NUMPAD6] = KeyboardEvent::KC_NUMPAD6;
    mKeyMap[OIS::KC_ADD] = KeyboardEvent::KC_ADD;
    mKeyMap[OIS::KC_NUMPAD1] = KeyboardEvent::KC_NUMPAD1;
    mKeyMap[OIS::KC_NUMPAD2] = KeyboardEvent::KC_NUMPAD2;
    mKeyMap[OIS::KC_NUMPAD3] = KeyboardEvent::KC_NUMPAD3;
    mKeyMap[OIS::KC_NUMPAD0] = KeyboardEvent::KC_NUMPAD0;
    mKeyMap[OIS::KC_DECIMAL] = KeyboardEvent::KC_DECIMAL;
    mKeyMap[OIS::KC_OEM_102] = KeyboardEvent::KC_OEM_102;
    mKeyMap[OIS::KC_F11] = KeyboardEvent::KC_F11;
    mKeyMap[OIS::KC_F12] = KeyboardEvent::KC_F12;
    mKeyMap[OIS::KC_F13] = KeyboardEvent::KC_F13;
    mKeyMap[OIS::KC_F14] = KeyboardEvent::KC_F14;
    mKeyMap[OIS::KC_F15] = KeyboardEvent::KC_F15;
    mKeyMap[OIS::KC_KANA] = KeyboardEvent::KC_KANA;
    mKeyMap[OIS::KC_ABNT_C1] = KeyboardEvent::KC_ABNT_C1;
    mKeyMap[OIS::KC_CONVERT] = KeyboardEvent::KC_CONVERT;
    mKeyMap[OIS::KC_NOCONVERT] = KeyboardEvent::KC_NOCONVERT;
    mKeyMap[OIS::KC_YEN] = KeyboardEvent::KC_YEN;
    mKeyMap[OIS::KC_ABNT_C2] = KeyboardEvent::KC_ABNT_C2;
    mKeyMap[OIS::KC_NUMPADEQUALS] = KeyboardEvent::KC_NUMPADEQUALS;
    mKeyMap[OIS::KC_PREVTRACK] = KeyboardEvent::KC_PREVTRACK;
    mKeyMap[OIS::KC_AT] = KeyboardEvent::KC_AT;
    mKeyMap[OIS::KC_COLON] = KeyboardEvent::KC_COLON;
    mKeyMap[OIS::KC_UNDERLINE] = KeyboardEvent::KC_UNDERLINE;
    mKeyMap[OIS::KC_KANJI] = KeyboardEvent::KC_KANJI;
    mKeyMap[OIS::KC_STOP] = KeyboardEvent::KC_STOP;
    mKeyMap[OIS::KC_AX] = KeyboardEvent::KC_AX;
    mKeyMap[OIS::KC_UNLABELED] = KeyboardEvent::KC_UNLABELED;
    mKeyMap[OIS::KC_NEXTTRACK] = KeyboardEvent::KC_NEXTTRACK;
    mKeyMap[OIS::KC_NUMPADENTER] = KeyboardEvent::KC_NUMPADENTER;
    mKeyMap[OIS::KC_RCONTROL] = KeyboardEvent::KC_RCONTROL;
    mKeyMap[OIS::KC_MUTE] = KeyboardEvent::KC_MUTE;
    mKeyMap[OIS::KC_CALCULATOR] = KeyboardEvent::KC_CALCULATOR;
    mKeyMap[OIS::KC_PLAYPAUSE] = KeyboardEvent::KC_PLAYPAUSE;
    mKeyMap[OIS::KC_MEDIASTOP] = KeyboardEvent::KC_MEDIASTOP;
    mKeyMap[OIS::KC_VOLUMEDOWN] = KeyboardEvent::KC_VOLUMEDOWN;
    mKeyMap[OIS::KC_VOLUMEUP] = KeyboardEvent::KC_VOLUMEUP;
    mKeyMap[OIS::KC_WEBHOME] = KeyboardEvent::KC_WEBHOME;
    mKeyMap[OIS::KC_NUMPADCOMMA] = KeyboardEvent::KC_NUMPADCOMMA;
    mKeyMap[OIS::KC_DIVIDE] = KeyboardEvent::KC_DIVIDE;
    mKeyMap[OIS::KC_SYSRQ] = KeyboardEvent::KC_SYSRQ;
    mKeyMap[OIS::KC_RMENU] = KeyboardEvent::KC_RMENU;
    mKeyMap[OIS::KC_PAUSE] = KeyboardEvent::KC_PAUSE;
    mKeyMap[OIS::KC_HOME] = KeyboardEvent::KC_HOME;
    mKeyMap[OIS::KC_UP] = KeyboardEvent::KC_UP;
    mKeyMap[OIS::KC_PGUP] = KeyboardEvent::KC_PGUP;
    mKeyMap[OIS::KC_LEFT] = KeyboardEvent::KC_LEFT;
    mKeyMap[OIS::KC_RIGHT] = KeyboardEvent::KC_RIGHT;
    mKeyMap[OIS::KC_END] = KeyboardEvent::KC_END;
    mKeyMap[OIS::KC_DOWN] = KeyboardEvent::KC_DOWN;
    mKeyMap[OIS::KC_PGDOWN] = KeyboardEvent::KC_PGDOWN;
    mKeyMap[OIS::KC_INSERT] = KeyboardEvent::KC_INSERT;
    mKeyMap[OIS::KC_DELETE] = KeyboardEvent::KC_DELETE;
    mKeyMap[OIS::KC_LWIN] = KeyboardEvent::KC_LWIN;
    mKeyMap[OIS::KC_RWIN] = KeyboardEvent::KC_RWIN;
    mKeyMap[OIS::KC_APPS] = KeyboardEvent::KC_APPS;
    mKeyMap[OIS::KC_POWER] = KeyboardEvent::KC_POWER;
    mKeyMap[OIS::KC_SLEEP] = KeyboardEvent::KC_SLEEP;
    mKeyMap[OIS::KC_WAKE] = KeyboardEvent::KC_WAKE;
    mKeyMap[OIS::KC_WEBSEARCH] = KeyboardEvent::KC_WEBSEARCH;
    mKeyMap[OIS::KC_WEBFAVORITES] = KeyboardEvent::KC_WEBFAVORITES;
    mKeyMap[OIS::KC_WEBREFRESH] = KeyboardEvent::KC_WEBREFRESH;
    mKeyMap[OIS::KC_WEBSTOP] = KeyboardEvent::KC_WEBSTOP;
    mKeyMap[OIS::KC_WEBFORWARD] = KeyboardEvent::KC_WEBFORWARD;
    mKeyMap[OIS::KC_WEBBACK] = KeyboardEvent::KC_WEBBACK;
    mKeyMap[OIS::KC_MYCOMPUTER] = KeyboardEvent::KC_MYCOMPUTER;
    mKeyMap[OIS::KC_MAIL] = KeyboardEvent::KC_MAIL;
    mKeyMap[OIS::KC_MEDIASELECT] = KeyboardEvent::KC_MEDIASELECT;

    mModifierMap[OIS::Keyboard::Ctrl] = KeyboardEvent::Ctrl;
    mModifierMap[OIS::Keyboard::Shift] = KeyboardEvent::Shift;
    mModifierMap[OIS::Keyboard::Alt] = KeyboardEvent::Alt;
  }