Beispiel #1
0
void CRenderWnd::OnEnter( wxMouseEvent &event )
{
	TRACEUSER( "Luke", _T("OnEnter %p\n"), event.GetEventObject() );
	
//	if( event.GetEventObject() != m_pFrame )
//		return;
	
	wxPoint				pt( event.GetPosition() );
	wxSetCursorEvent	CursorEvent( pt.x, pt.y );
	m_pView->OnSetCursor( CursorEvent );
	if( CursorEvent.HasCursor() )
	{
		wxSetCursor( CursorEvent.GetCursor() );
	}
}
void WinInputManager::Run(UINT const & msg, WPARAM wParam, LPARAM lParam)
{
    if (m_listenerList.empty())
        return;

    eKeyCodes KeyIndex;
    wchar_t buffer[1];
    BYTE lpKeyState[256];

    CursorEvent();
    switch (msg)
    {
    case WM_KEYDOWN:
        KeyIndex = static_cast<eKeyCodes>(wParam);
        GetKeyboardState(lpKeyState);
        ToUnicode(wParam, HIWORD(lParam) & 0xFF, lpKeyState, buffer, 1, 0);
        KeyEvent(KeyIndex, buffer[0], true);
        break;
    case WM_KEYUP:
        KeyIndex = static_cast<eKeyCodes>(wParam);
        GetKeyboardState(lpKeyState);
        ToUnicode(wParam, HIWORD(lParam) & 0xFF, lpKeyState, buffer, 1, 0);
        KeyEvent(KeyIndex, buffer[0], false);
        break;
    case WM_LBUTTONDOWN:
        MouseEvent(MOUSE_LEFT, true);
        break;
    case WM_LBUTTONUP:
        MouseEvent(MOUSE_LEFT, false);
        break;
    case WM_RBUTTONDOWN:
        MouseEvent(MOUSE_RIGHT, true);
        break;
    case WM_RBUTTONUP:
        MouseEvent(MOUSE_RIGHT, false);
        break;
    case WM_MBUTTONDOWN:
        MouseEvent(MOUSE_MIDDLE, true);
        break;
    case WM_MBUTTONUP:
        MouseEvent(MOUSE_MIDDLE, false);
        break;
    case WM_MOUSEWHEEL:
        MouseWheelEvent((short)GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA);
        break;
    }
}
Beispiel #3
0
/*********************************************************************************************
>	afx_msg void CRenderWnd::OnMouseMove(UINT32, CPoint)

	Author:		Justin_Flude (Xara Group Ltd) <*****@*****.**>
	Created:	ages ago
	Inputs:		Not used.
	Outputs:	-
	Returns:	-
	Purpose:	Passes the mouse message on to the parent CCamView via a call to
				CRenderWnd::PassMsgToParent().
	Errors:		-
	Scope:	    Protected
	SeeAlso:    CRenderWnd::PassMsgToParent(); CCamView::OnMouseMove()

**********************************************************************************************/ 
void CRenderWnd::OnMouseMove( wxMouseEvent &event )
{
	if (m_pView)
		m_pView->OnMouseMove( event );
	
#if defined(__WXGTK__)
	wxSetCursorEvent	CursorEvent( event.m_x, event.m_y );
	OnSetCursor( CursorEvent );
	if( CursorEvent.HasCursor() )
	{
		// The window cursor seems to be ignored, but is needed for
		// CaptureMouse to work
		wxSetCursor( CursorEvent.GetCursor() );
		SetCursor( CursorEvent.GetCursor() );
	}
#endif
}