Nebula
Loading...
Searching...
No Matches
inputhandler.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
17#include "core/refcounted.h"
18#include "input/inputevent.h"
19
20namespace Base
21{
22 class InputServerBase;
23}
24
25//------------------------------------------------------------------------------
26namespace Input
27{
29{
31public:
35 virtual ~InputHandler();
36
38 bool IsAttached() const;
40 virtual void BeginCapture();
42 virtual void EndCapture();
44 bool IsCapturing() const;
45
48 virtual void Poll();
49
50protected:
52
54 virtual void OnAttach();
56 virtual void OnRemove();
58 virtual void OnBeginFrame();
60 virtual void OnEndFrame();
62 virtual void OnObtainCapture();
64 virtual void OnReleaseCapture();
66 virtual bool OnEvent(const InputEvent& inputEvent);
68 virtual void OnReset();
69
72};
73
74//------------------------------------------------------------------------------
77inline bool
79{
80 return this->isAttached;
81}
82
83//------------------------------------------------------------------------------
86inline bool
88{
89 return this->isCapturing;
90}
91
92} // namespace Input
93//------------------------------------------------------------------------------
94
The InputServer is the central object of the Input subsystem.
Definition inputserverbase.h:33
The common base class of Nebula.
Definition refcounted.h:45
The input events of the Input subsystems.
Definition inputevent.h:25
virtual void BeginCapture()
capture input to this event handler
Definition inputhandler.cc:40
virtual void OnObtainCapture()
called when input handler obtains capture
Definition inputhandler.cc:98
bool IsCapturing() const
return true if this input handler captures input
Definition inputhandler.h:87
virtual void OnEndFrame()
called on InputServer::EndFrame();
Definition inputhandler.cc:89
virtual void OnReleaseCapture()
called when input handler looses capture
Definition inputhandler.cc:107
virtual void OnRemove()
called when the handler is removed from the input server
Definition inputhandler.cc:70
bool isAttached
Definition inputhandler.h:70
bool IsAttached() const
return true if the input handler is currently attached
Definition inputhandler.h:78
bool isCapturing
Definition inputhandler.h:71
virtual void Poll()
take this frame's state from the device.
Definition inputhandler.cc:138
virtual bool OnEvent(const InputEvent &inputEvent)
called when an input event should be processed
Definition inputhandler.cc:116
virtual void OnBeginFrame()
called on InputServer::BeginFrame()
Definition inputhandler.cc:80
virtual void OnReset()
called when the handler should reset itself
Definition inputhandler.cc:150
__DeclareClass(InputHandler)
virtual void EndCapture()
end input capturing to this event handler
Definition inputhandler.cc:51
InputHandler()
constructor
Definition inputhandler.cc:16
virtual void OnAttach()
called when the handler is attached to the input server
Definition inputhandler.cc:60
Definition gamecontentserverbase.cc:10
FIXME!