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
20
namespace
Base
21
{
22
class
InputServerBase;
23
}
24
25
//------------------------------------------------------------------------------
26
namespace
Input
27
{
28
class
InputHandler
:
public
Core::RefCounted
29
{
30
__DeclareClass
(
InputHandler
);
31
public
:
33
InputHandler
();
35
virtual
~InputHandler
();
36
38
bool
IsAttached
()
const
;
40
virtual
void
BeginCapture
();
42
virtual
void
EndCapture
();
44
bool
IsCapturing
()
const
;
45
46
protected
:
47
friend
class
Base::InputServerBase
;
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
66
bool
isAttached
;
67
bool
isCapturing
;
68
};
69
70
//------------------------------------------------------------------------------
73
inline
bool
74
InputHandler::IsAttached
()
const
75
{
76
return
this->
isAttached
;
77
}
78
79
//------------------------------------------------------------------------------
82
inline
bool
83
InputHandler::IsCapturing
()
const
84
{
85
return
this->
isCapturing
;
86
}
87
88
}
// namespace Input
89
//------------------------------------------------------------------------------
90
Base::InputServerBase
The InputServer is the central object of the Input subsystem.
Definition
inputserverbase.h:32
Core::RefCounted
The common base class of Nebula.
Definition
refcounted.h:38
Input::InputEvent
The input events of the Input subsystems.
Definition
inputevent.h:24
Input::InputHandler
Input handlers receive and process input events.
Definition
inputhandler.h:29
Input::InputHandler::BeginCapture
virtual void BeginCapture()
capture input to this event handler
Definition
inputhandler.cc:40
Input::InputHandler::OnObtainCapture
virtual void OnObtainCapture()
called when input handler obtains capture
Definition
inputhandler.cc:98
Input::InputHandler::IsCapturing
bool IsCapturing() const
return true if this input handler captures input
Definition
inputhandler.h:83
Input::InputHandler::OnEndFrame
virtual void OnEndFrame()
called on InputServer::EndFrame();
Definition
inputhandler.cc:89
Input::InputHandler::OnReleaseCapture
virtual void OnReleaseCapture()
called when input handler looses capture
Definition
inputhandler.cc:107
Input::InputHandler::OnRemove
virtual void OnRemove()
called when the handler is removed from the input server
Definition
inputhandler.cc:70
Input::InputHandler::isAttached
bool isAttached
Definition
inputhandler.h:66
Input::InputHandler::IsAttached
bool IsAttached() const
return true if the input handler is currently attached
Definition
inputhandler.h:74
Input::InputHandler::isCapturing
bool isCapturing
Definition
inputhandler.h:67
Input::InputHandler::OnEvent
virtual bool OnEvent(const InputEvent &inputEvent)
called when an input event should be processed
Definition
inputhandler.cc:116
Input::InputHandler::OnBeginFrame
virtual void OnBeginFrame()
called on InputServer::BeginFrame()
Definition
inputhandler.cc:80
Input::InputHandler::OnReset
virtual void OnReset()
called when the handler should reset itself
Definition
inputhandler.cc:141
Input::InputHandler::__DeclareClass
__DeclareClass(InputHandler)
Input::InputHandler::~InputHandler
virtual ~InputHandler()
destructor
Definition
inputhandler.cc:26
Input::InputHandler::EndCapture
virtual void EndCapture()
end input capturing to this event handler
Definition
inputhandler.cc:51
Input::InputHandler::InputHandler
InputHandler()
constructor
Definition
inputhandler.cc:16
Input::InputHandler::OnAttach
virtual void OnAttach()
called when the handler is attached to the input server
Definition
inputhandler.cc:60
inputevent.h
Base
Definition
gamecontentserverbase.cc:10
Input
FIXME!
refcounted.h
code
input
input
inputhandler.h
Generated on Thu Nov 14 2024 22:10:55 for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.