forked from Arisego/cocotd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EventCenter.h
42 lines (31 loc) · 913 Bytes
/
EventCenter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* 事件机制管理类
| -鼠标右键和键盘等windows独有事件的处理类
|
*/
#include "cocos2d.h"
#include "utils/Controller.h"
#ifndef __EVENT_CENTER_H__
#define __EVENT_CENTER_H__
class EventCenter
{
public:
static EventCenter *sharedEventCenter();
static void purgeSharedEventCenter();
bool init();
static void ehandler(UINT message,WPARAM wParam, LPARAM lParam );
void setController(Controller* c = NULL); //设置控制器,调空置空
void setScroller(Scroller* s = NULL);
void setSelector(Selector* s = NULL);
void setBmCake(Cake* s = NULL);
static void handlekeydown(WPARAM wParam, LPARAM lParam);
static void handlekeyup(WPARAM wParam, LPARAM lParam);
static void handlerightm(WPARAM wParam, LPARAM lParam);
~EventCenter();
private:
static EventCenter* mSharedEventCenter;
static Controller* mController;
static Scroller* mScroller;
static Selector* mSelector;
static Cake* m_bm_cake;
};
#endif