void CMouseHandler::EmptyMsgQueUpdate(void) { if(hide && mouseMovedFromCenter){ recenter_mouse(); internalMouseMove=true; //this only works if the msg que is empty of mouse moves, so someone should figure out something better mouseMovedFromCenter=false; } }
void CMouseHandler::HideMouse() { if(!hide){ lastx = gu->screenx/2; lasty = gu->screeny/2; SDL_ShowCursor(SDL_DISABLE); recenter_mouse(); hide=true; } }
void enter_mouse(short type) { if (type != _keyboard_or_game_pad) { #ifndef DEBUG SDL_WM_GrabInput(SDL_GRAB_ON); #endif SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE); mouse_active = true; snapshot_delta_yaw = snapshot_delta_pitch = snapshot_delta_velocity = 0; snapshot_delta_scrollwheel = 0; button_mask = 0; // Disable all buttons (so a shot won't be fired if we enter the game with a mouse button down from clicking a GUI widget) recenter_mouse(); } }
void change_screen_mode(struct screen_mode_data *mode, bool redraw) { // Get the screen mode here screen_mode = *mode; // "Redraw" change now and clear the screen if (redraw) { int msize = mode->size; assert(msize >= 0 && msize < NUMBER_OF_VIEW_SIZES); change_screen_mode(ViewSizes[msize].OverallWidth, ViewSizes[msize].OverallHeight, mode->bit_depth, false); clear_screen(); recenter_mouse(); } frame_count = frame_index = 0; }
void enter_mouse(short type) { if (type != _keyboard_or_game_pad) { #ifdef __APPLE__ //DCW no mouse on ios //if (input_preferences->raw_mouse_input) //OSX_Mouse_Init(); #endif //DCW clear mouse deltas. float dx, dy; slurpMouseDelta(&dx, &dy); SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, input_preferences->raw_mouse_input ? "0" : "1"); SDL_SetRelativeMouseMode(SDL_TRUE); mouse_active = true; snapshot_delta_yaw = snapshot_delta_pitch = 0; snapshot_delta_scrollwheel = 0; snapshot_delta_x = snapshot_delta_y = 0; lost_x = lost_y = 0; button_mask = 0; // Disable all buttons (so a shot won't be fired if we enter the game with a mouse button down from clicking a GUI widget) recenter_mouse(); } }