void GSPanel::AppStatusEvent_OnSettingsApplied() { if( IsBeingDeleted() ) return; DoResize(); DoShowMouse(); Show( !EmuConfig.GS.DisableOutput ); }
void GSPanel::OnFocus( wxFocusEvent& evt ) { evt.Skip(); m_HasFocus = true; if( g_Conf->GSWindow.AlwaysHideMouse ) { SetCursor( wxCursor(wxCURSOR_BLANK) ); m_CursorShown = false; } else DoShowMouse(); #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event = {0, 9}; // X equivalent of FocusIn; PADWriteEvent(event); } #endif //Console.Warning("GS frame > focus set"); UpdateScreensaver(); }
void GSPanel::OnMouseEvent( wxMouseEvent& evt ) { if( IsBeingDeleted() ) return; // Do nothing for left-button event if (!evt.Button(wxMOUSE_BTN_LEFT)) { evt.Skip(); DoShowMouse(); } #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event; // FIXME how to handle double click ??? if (evt.ButtonDown()) { event.evt = 4; // X equivalent of ButtonPress event.key = evt.GetButton(); } else if (evt.ButtonUp()) { event.evt = 5; // X equivalent of ButtonRelease event.key = evt.GetButton(); } else if (evt.Moving() || evt.Dragging()) { event.evt = 6; // X equivalent of MotionNotify long x,y; evt.GetPosition(&x, &y); wxCoord w, h; wxWindowDC dc( this ); dc.GetSize(&w, &h); // Special case to allow continuous mouvement near the border if (x < 10) x = 0; else if (x > (w-10)) x = 0xFFFF; if (y < 10) y = 0; else if (y > (w-10)) y = 0xFFFF; // For compatibility purpose with the existing structure. I decide to reduce // the position to 16 bits. event.key = ((y & 0xFFFF) << 16) | (x & 0xFFFF); } else { event.key = 0; event.evt = 0; } PADWriteEvent(event); } #endif }
void GSPanel::OnFocusLost( wxFocusEvent& evt ) { evt.Skip(); m_HasFocus = false; DoShowMouse(); #ifdef __linux__ // TODO OSX handle properly these HACK2: otherwise events are not recognized // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event = {0, 10}; // X equivalent of FocusOut PADWriteEvent(event); } #endif //Console.Warning("GS frame > focus lost"); }
void GSPanel::OnFocusLost( wxFocusEvent& evt ) { evt.Skip(); m_HasFocus = false; DoShowMouse(); #if defined(__unix__) // HACK2: In gsopen2 there is one event buffer read by both wx/gui and pad plugin. Wx deletes // the event before the pad see it. So you send key event directly to the pad. if( (PADWriteEvent != NULL) && (GSopen2 != NULL) ) { keyEvent event = {0, 10}; // X equivalent of FocusOut PADWriteEvent(event); } #endif //Console.Warning("GS frame > focus lost"); UpdateScreensaver(); }
void GSPanel::AppStatusEvent_OnSettingsApplied() { if( IsBeingDeleted() ) return; DoResize(); DoShowMouse(); }