An input handler which represents a mouse for polling.
Definition mousebase.h:19
virtual void LockToPosition(bool locked, Math::vec2 &position)
locks the mouse to a screen position (0.0 .. 1.0)
Definition mousebase.h:185
Util::FixedArray< ButtonState > buttonStates
Definition mousebase.h:86
bool WheelForward() const
return true if mouse wheel rotated forward
Definition mousebase.h:167
virtual bool OnEvent(const Input::InputEvent &inputEvent)
called when an input event should be processed
Definition mousebase.cc:114
bool ButtonUp(Input::MouseButton::Code btn) const
return true if button was released at least once in current frame
Definition mousebase.h:122
bool ButtonDoubleClicked(Input::MouseButton::Code btn) const
return true if a button has been double clicked
Definition mousebase.h:131
bool ButtonDown(Input::MouseButton::Code btn) const
return true if button was pushed down at least once in current frame
Definition mousebase.h:113
virtual void OnReleaseCapture()
called when input handler looses capture
Definition mousebase.cc:227
Math::vec2 movement
Definition mousebase.h:91
virtual void BeginCapture()
capture input to this event handler
Definition mousebase.cc:42
const Math::vec2 & GetPixelPosition() const
get current absolute mouse position (in pixels)
Definition mousebase.h:140
MouseBase()
constructor
Definition mousebase.cc:19
bool wheelForward
Definition mousebase.h:93
bool ButtonPressed(Input::MouseButton::Code btn) const
return true if button is currently pressed
Definition mousebase.h:104
const Math::vec2 & GetMovement() const
get mouse movement
Definition mousebase.h:158
bool mouseLocked
Definition mousebase.h:96
virtual ~MouseBase()
destructor
Definition mousebase.cc:33
Math::vec2 pixelPosition
Definition mousebase.h:89
Math::vec2 screenPosition
Definition mousebase.h:90
virtual void EndCapture()
end input capturing to this event handler
Definition mousebase.cc:52
bool WheelBackward() const
return true if mouse wheel rotated backward
Definition mousebase.h:176
__DeclareClass(MouseBase)
const Math::vec2 & GetScreenPosition() const
get current screen space mouse position (0.0 .. 1.0)
Definition mousebase.h:149
bool wheelBackward
Definition mousebase.h:94
void UpdateMousePositions(const Math::vec2 &pixelPos, const Math::vec2 &screenPos)
update mouse position members
Definition mousebase.cc:241
bool IsLocked() const
return true if the mouse is locked
Definition mousebase.h:196
Math::vec2 beginFrameScreenPosition
Definition mousebase.h:88
virtual void OnBeginFrame()
called on InputServer::BeginFrame()
Definition mousebase.cc:82
Math::vec2 mouseLockedPosition
Definition mousebase.h:92
bool initialMouseMovement
Definition mousebase.h:95
virtual void OnAttach()
called when the handler is attached to the input server
Definition mousebase.cc:62
virtual void OnObtainCapture()
called when input handler obtains capture
Definition mousebase.cc:213
virtual void OnReset()
reset the input handler
Definition mousebase.cc:259
bool mouseWasLocked
Definition mousebase.h:97
Math::vec2 beginFramePixelPosition
Definition mousebase.h:87
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
Definition gamecontentserverbase.cc:10
A 2-component float vector class.
Definition vec2.h:21