/////////////////////////////////////////////////////////////////////////////////////////////////// /// CelShadeApp::ReceiveEvent /////////////////////////////////////////////////////////////////////////////////////////////////// void CelShadeApp::ReceiveEvent( const Event* pEvent) { if (pEvent->GetType() == EventTypeKeyDown) { HandleKeyboardInput(pEvent); } else { IvyApp::ReceiveEvent(pEvent); } }
void Input::PeekInputEvents() { SDL_Event mouseEvents[2]; SDL_Event keyboardEvents[2]; SDL_PumpEvents(); int mouseCount = SDL_PeepEvents(mouseEvents, 2, SDL_GETEVENT, SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP); int keyboardCount = SDL_PeepEvents(keyboardEvents, 2, SDL_GETEVENT, SDL_KEYDOWN, SDL_KEYUP); HandleKeyboardInput(keyboardEvents, keyboardCount); HandleMouseInput(mouseEvents, mouseCount); }
void Game::HandleInput() { keyStates = 0; // reset states for current frame HandleWindowInput(); HandleKeyboardInput(); HandleJoystickInput(); if (keyStates != 0) { hasStarted = true; } }
void FlyCamera::Update( real64_t dt ) { Cvar *r_zRange = Cvar::Get( "r_zRange" ); real32_t zNear = r_zRange->GetReal32( 0 ); real32_t zFar = r_zRange->GetReal32( 1 ); SetupPerspective( glm::radians( cg_fov->GetReal32() ), Renderer::rdState.window.aspectRatio, zNear, zFar ); HandleKeyboardInput( dt ); HandleMouseInput( dt ); }
GLvoid IdleGLScene(){ if(HandleKeyboardInput()) { glutPostRedisplay(); } // double now = (double)clock() / ((double)CLOCKS_PER_SEC); // if(now - last_update > UPDATE_INC) // { // for(int i=0; i<bad_guys.size(); i++) // { // vec4 pos = characters[bad_guys[i]]->transform*vec4(0,0,0); // pos.normalize(); // pos *= BAD_GUY_SPEED; // characters[bad_guys[i]]->transform.translate(-pos.x, -pos.y, -pos.z); // } // glutPostRedisplay(); // } }
void BLOCO_API HumanView::Console::CustomOnKeyDown( const cil::CIL_KEY c ) { if(IsActive()) { if( c != VK_OEM_2 ) { HandleKeyboardSysKey(c, true); if (c != VK_BACK && c != VK_RETURN && c != VK_OEM_5) { std::string s = ToAscii(c); if(!s.empty()) { HandleKeyboardInput( s ); } } } } }
void FlyCamera::Update(double dt) { HandleKeyboardInput(dt); HandleMouseInput(dt); }
void Player::update(float delta) { HandleKeyboardInput(); }