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
46protected:
48
50 virtual void OnAttach();
52 virtual void OnRemove();
54 virtual void OnBeginFrame();
56 virtual void OnEndFrame();
58 virtual void OnObtainCapture();
60 virtual void OnReleaseCapture();
62 virtual bool OnEvent(const InputEvent& inputEvent);
64 virtual void OnReset();
65
68};
69
70//------------------------------------------------------------------------------
73inline bool
75{
76 return this->isAttached;
77}
78
79//------------------------------------------------------------------------------
82inline bool
84{
85 return this->isCapturing;
86}
87
88} // namespace Input
89//------------------------------------------------------------------------------
90
The InputServer is the central object of the Input subsystem.
Definition inputserverbase.h:32
The common base class of Nebula.
Definition refcounted.h:38
The input events of the Input subsystems.
Definition inputevent.h:24
Input handlers receive and process input events.
Definition inputhandler.h:29
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:83
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:66
bool IsAttached() const
return true if the input handler is currently attached
Definition inputhandler.h:74
bool isCapturing
Definition inputhandler.h:67
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:141
__DeclareClass(InputHandler)
virtual ~InputHandler()
destructor
Definition inputhandler.cc:26
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!