Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <mitkLogMacros.h>
00019
00020 #ifndef SpaceNavigatorDriver__h__
00021 #define SpaceNavigatorDriver__h__
00022
00023 #ifdef SPACE_NAVIGATOR_MAIN_SOURCE
00024
00025 #define _ATL_ATTRIBUTES 1
00026 #define _WIN32_DCOM
00027
00028 #include <atlbase.h>
00029 #include <atlcom.h>
00030 #include <atlwin.h>
00031 #include <atltypes.h>
00032 #include <atlctl.h>
00033 #include <atlhost.h>
00034
00035 #import "progid:TDxInput.Device" embedded_idl no_namespace
00036
00037 using namespace ATL;
00038
00039 #include <mitkVector.h>
00040 #include <iostream>
00041
00042 using std::cout;
00043 using std::endl;
00044
00045 [module(name="mitkInputDevices")];
00046 [ event_receiver(com) ]
00047 class SpaceNavigatorDriver
00048 {
00049 public:
00050 static SpaceNavigatorDriver* GetInstance();
00051
00052 private:
00053
00054 SpaceNavigatorDriver();
00055 ~SpaceNavigatorDriver();
00056
00057
00058
00059 inline HRESULT HookEvent1(CComPtr<ISimpleDevice> device);
00060 inline HRESULT HookEvent2();
00061 inline HRESULT HookEvent3(CComPtr<ISimpleDevice> device);
00062 inline HRESULT HookEvent4();
00063 inline HRESULT HookEvent5();
00064
00065 #if 1
00066 CComPtr<ISensor> m_pISensor;
00067 CComPtr<IKeyboard> m_pIKeyboard;
00068 #else
00069 ISensorPtr m_pISensor;
00070 IKeyboardPtr m_pIKeyboard;
00071 #endif
00072
00073 public:
00074
00075
00076 HRESULT InitializeCOM();
00077 HRESULT OnDeviceChange (long reserved);
00078 HRESULT OnKeyDown (int keyCode);
00079 HRESULT OnKeyUp (int keyCode);
00080 HRESULT OnSensorInput(void);
00081 HRESULT UninitializeCOM();
00082 };
00083 #else // SPACE_NAVIGATOR_MAIN_SOURCE
00084
00085 class SpaceNavigatorDriver
00086 {
00087 public:
00088 static SpaceNavigatorDriver* GetInstance();
00089 };
00090
00091 #endif
00092
00093 #endif // SpaceNavigatorDriver__h__