00001
00002
00003 #ifndef _IRRLICHTEVENTRECEIVER_H_INCLUDED_
00004 #define _IRRLICHTEVENTRECEIVER_H_INCLUDED_
00005
00006
00007 typedef ERR_TYPE (*irrlichtKeyEventCallback_TYPE)(EKEY_CODE);
00008 typedef ERR_TYPE (*irrlichtMouseButtonEventCallback_TYPE)(s32 x, s32 y, f32 wheel);
00009 typedef ERR_TYPE (*irrlichtMouseButtonReleaseEventCallback_TYPE)();
00010 typedef ERR_TYPE (*irrlichtMouseMoveEventCallback_TYPE)(s32 x, s32 y);
00011
00012
00013
00014
00015
00016
00017
00018
00019 class IrrlichtEventReceiver : public IEventReceiver
00020 {
00021 public:
00022 IrrlichtEventReceiver();
00023 ~IrrlichtEventReceiver();
00024
00025 ERR_TYPE registerKeyEventCallback( irrlichtKeyEventCallback_TYPE anyCallBackFunction );
00026 ERR_TYPE registerMouseButtonLeftEventCallback( irrlichtMouseButtonEventCallback_TYPE anyCallBackFunction );
00027 ERR_TYPE registerMouseButtonLeftReleaseEventCallback( irrlichtMouseButtonReleaseEventCallback_TYPE anyCallBackFunction );
00028 ERR_TYPE registerMouseButtonLeftDoubleClickEventCallback( irrlichtMouseButtonEventCallback_TYPE anyCallBackFunction );
00029 ERR_TYPE registerMouseButtonRightEventCallback( irrlichtMouseButtonEventCallback_TYPE anyCallBackFunction );
00030 ERR_TYPE registerMouseButtonRightReleaseEventCallback( irrlichtMouseButtonReleaseEventCallback_TYPE anyCallBackFunction );
00031 ERR_TYPE registerMouseMoveEventCallback( irrlichtMouseMoveEventCallback_TYPE anyCallBackFunction );
00032
00033 virtual bool OnEvent( SEvent event );
00034
00035 private:
00036 irrlichtKeyEventCallback_TYPE theOneToCallOnKeyEvent;
00037 irrlichtMouseButtonEventCallback_TYPE theOneToCallOnMouseButtonLeftEvent;
00038 irrlichtMouseButtonReleaseEventCallback_TYPE theOneToCallOnMouseButtonLeftReleaseEvent;
00039 irrlichtMouseButtonEventCallback_TYPE theOneToCallOnMouseButtonLeftDoubleClickEvent;
00040 irrlichtMouseButtonEventCallback_TYPE theOneToCallOnMouseButtonRightEvent;
00041 irrlichtMouseButtonReleaseEventCallback_TYPE theOneToCallOnMouseButtonRightReleaseEvent;
00042 irrlichtMouseMoveEventCallback_TYPE theOneToCallOnMouseMoveEvent;
00043 u32 previousMouseButtonLeftClick;
00044 };
00045
00046
00047 #endif // #ifndef _IRRLICHTEVENTRECEIVER_H_INCLUDED_