Fission FSN
Loading...
Searching...
No Matches
fsCInputManager.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCInputManager.h
4*
5* Purpose: cocos2dx input manager impl
6*
7*********************************************************************/
8
9#ifndef fsCInputManagerhdr
10#define fsCInputManagerhdr
11
12#include <fsCore/fsBaseTypes.h>
13
14#ifdef AXMOL_V3
15
16#include "v3/fsCInputManager.h"
17
18#else
19
20#include <base/EventListenerMouse.h>
21#include <base/EventListenerKeyboard.h>
22#include <base/EventListenerTouch.h>
23#include <base/EventListenerController.h>
24#include <base/EventController.h>
25
27#include <fsCore/fsStr.h>
28
29
31{
32 friend class fsIInputManager;
33
34public:
35
36 fsS32 pointerTypeGet() const override;
37 fsBool hasPhysicalKeyboardGet() const override;
38
39protected:
40
41 void pollKeys() override;
42
43 virtual void stolenInputDo()
44 {
45 }
46
47 void initialiseDo() override;
48 void uninitialiseDo() override;
49 fsBool keyDecodeDo(fsS32& pKeyCode) override;
50
52 virtual ~fsCInputManager();
53
54private:
55
56#if (defined(fsDesktop) || defined(fsWeb))
57 void mouseListenerCreate();
58 fsBool mouseButtonDownEventCallback(axmol::EventMouse* pEvent);
59 fsBool mouseButtonUpEventCallback(axmol::EventMouse* pEvent);
60 fsBool mouseMoveEventCallback(axmol::EventMouse* pEvent);
61 axmol::EventListenerMouse* mMouseListener;
62#endif
63
64
65 void controllerKeyUpEventCallback(ax::Controller* pController, int pKeyCode, axmol::Event* pEvent);
66 void controllerKeyDownEventCallback(ax::Controller* pController, int pKeyCode, axmol::Event* pEvent);
67 void gamePadListenerCreate();
68
69 void keyboardListenerCreate();
70 void keyUpEventCallback(axmol::EventKeyboard::KeyCode pKeyCode, axmol::Event* pEvent);
71 void keyDownEventCallback(axmol::EventKeyboard::KeyCode pKeyCode, axmol::Event* pEvent);
72
73 void touchListenerCreate();
74 fsBool touchStartEventCallback(axmol::Touch* pTouch, axmol::Event* pEvent);
75 void touchEndEventCallback(axmol::Touch* pTouch, axmol::Event* pEvent);
76 void touchMoveEventCallback(axmol::Touch* pTouch, axmol::Event* pEvent);
77
78 axmol::EventListenerKeyboard* mKeyboardListener;
79 axmol::EventListenerTouchOneByOne* mTouchListener;
80 axmol::EventListenerController* mGamePadListener;
81
82};
83
84#endif
85
86#endif
friend class fsIInputManager
Definition fsCInputManager.h:32
void uninitialiseDo() override
Definition fsCInputManager.cpp:257
void pollKeys() override
Definition fsCInputManager.cpp:20
fsBool hasPhysicalKeyboardGet() const override
Definition fsCInputManager.cpp:48
fsBool keyDecodeDo(fsS32 &pKeyCode) override
Definition fsCInputManager.cpp:123
virtual ~fsCInputManager()
Definition fsCInputManager.cpp:277
virtual void stolenInputDo()
Definition fsCInputManager.h:43
fsCInputManager()
Definition fsCInputManager.cpp:267
fsS32 pointerTypeGet() const override
Definition fsCInputManager.cpp:57
void initialiseDo() override
Definition fsCInputManager.cpp:237
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20