00001
00002
00003
00004
00005 #ifndef WinEventToSoEvent_h
00006 #define WinEventToSoEvent_h
00007
00008 #include <Inventor/ViewerComponents/SoEventBuilder.h>
00009 #include <Inventor/Events/SoMouseButtonEvent.h>
00010
00011 class RenderArea;
00012
00016 class WINVIEWERCOMPONENTS_API WinEventToSoEvent
00017 {
00018
00019 public:
00020
00024 static SoMouseButtonEvent* getMousePressEvent( LPARAM loc, SoMouseButtonEvent::Button button, RenderArea* renderArea );
00025
00029 static SoMouseButtonEvent* getMouseReleaseEvent( LPARAM loc, SoMouseButtonEvent::Button button, RenderArea* renderArea );
00030
00034 static SoMouseButtonEvent* getMouseDoubleClickEvent( LPARAM loc, SoMouseButtonEvent::Button button, RenderArea* renderArea );
00035
00039 static SoLocation2Event* getMouseMoveEvent( LPARAM loc, RenderArea* renderArea );
00040
00044 static SoMouseWheelEvent* getMouseWheelEvent( short zDelta, RenderArea* );
00045
00049 static SoLocation2Event* getMouseEnterEvent( RenderArea* );
00050
00054 static SoLocation2Event* getMouseLeaveEvent( RenderArea* );
00055
00059 static SoKeyboardEvent* getKeyPressEvent( WPARAM param, RenderArea* );
00060
00064 static SoKeyboardEvent* getKeyReleaseEvent( WPARAM param, RenderArea* );
00065
00069 static void getTouchEvents( WPARAM wParam, LPARAM lParam, RenderArea*, std::vector<const SoEvent*>& eventsList );
00070
00071 private:
00072 static bool initClass();
00073 static bool s_init;
00074
00075 static SoKeyboardEvent::Key getIvKey( WPARAM param );
00076 static SoEventBuilder m_ivEvent;
00077 static std::map<DWORD, unsigned int> m_touchIDMap;
00078
00079 static SoKeyboardEvent::Key keyMap[256];
00080 static int keyMapInitFlag;
00081
00082 static bool m_ctrlModifier;
00083 static bool m_altModifier;
00084 static bool m_shiftModifier;
00085
00086 static SbVec2s getMousePosition( LPARAM loc );
00087 };
00088
00089 #endif // WinEventToSoEvent
00090