hx3d  1
2D/3D Simple Game Framework
Public Member Functions | Protected Attributes | List of all members
hx3d::window::EventManager Class Referenceabstract

Manage real-time inputs. More...

#include <event_manager.hpp>

Public Member Functions

virtual void poll ()=0
 Poll the event queue.
 
bool isWindowState (WindowEvent::Type type)
 Test the window state. More...
 
bool isMouseButtonClicked (MouseButtonEvent::Button button)
 Test if a mouse button have been clicked. More...
 
bool isMouseButtonReleased (MouseButtonEvent::Button button)
 Test if a mouse button have been relased. More...
 
bool isMouseButtonJustClicked (MouseButtonEvent::Button button)
 Test if a mouse button have just been clicked. More...
 
bool isMouseButtonJustReleased (MouseButtonEvent::Button button)
 Test if a mouse button have just been released. More...
 
bool isMouseWheelTurned (MouseWheelEvent::Direction direction)
 Test if the mouse wheel have been turned in a direction. More...
 
bool isScreenTouched ()
 Test if the screen have been touched. More...
 
bool isScreenReleased ()
 Test if the screen have been released. More...
 
bool isScreenJustTouched ()
 Test if the screen have been just touched. More...
 
bool isScreenJustReleased ()
 Test if the screen have been just released. More...
 
bool isKeyPressed (KeyEvent::Key key)
 Test if the key have been pressed. More...
 
bool isKeyReleased (KeyEvent::Key key)
 Test if the key have been released. More...
 
bool isKeyJustPressed (KeyEvent::Key key)
 Test if the key have just been pressed. More...
 
bool isKeyJustReleased (KeyEvent::Key key)
 Test if the key have just been released. More...
 
glm::vec2 getMousePosition ()
 Get the current mouse position. More...
 
glm::vec2 getMouseMovement ()
 Get the current mouse movement. More...
 
glm::vec2 getMouseWheelMovement ()
 Get the current mouse wheel movement. More...
 
glm::vec2 getTouchPosition ()
 Get the current touch position. More...
 
glm::vec2 getScreenConvertedTouchPosition ()
 Get the screen converted touch position. More...
 
glm::vec2 getTouchMovement ()
 Get the current touch movement. More...
 
float getTouchPressure ()
 Get the current touch pressure. More...
 
void emulateTouchWithMouse (bool value)
 Emulate the touch system with the mouse. More...
 
void setInputHandler (InputHandler *handler)
 Define an input handler. More...
 
void setInputHandler (Ptr< InputHandler > handler)
 Define an input handler. More...
 

Protected Attributes

bool * _keysReleased
 Keys released.
 
bool * _keysPressed
 Keys pressed.
 
bool * _mouseButtonClicked
 Mouse buttons clicked.
 
bool * _mouseButtonReleased
 Mouse buttons released.
 
bool * _mouseWheelTurned
 Mouse wheels turned.
 
bool * _windowEvents
 Window events.
 
bool _screenTouched
 Screen touched ?
 
bool _screenReleased
 Screen released ?
 
glm::vec2 _mousePosition
 Mouse position.
 
glm::vec2 _mouseMovement
 Mouse movement.
 
glm::vec2 _mouseWheelMovement
 Mouse wheel movement.
 
glm::vec2 _touchPosition
 Touch position.
 
glm::vec2 _touchMovement
 Touch movement.
 
float _touchPressure
 Touch pressure.
 
bool _touchSimulation
 Is touch simulated with mouse ?
 
InputHandler_currentHandler
 Current input handler.
 

Detailed Description

Manage real-time inputs.

Definition at line 39 of file event_manager.hpp.

Member Function Documentation

void hx3d::window::EventManager::emulateTouchWithMouse ( bool  value)

Emulate the touch system with the mouse.

This will emulate the touch position and the touch movement. When clicked, the touch pressure will be at 1.0.

Parameters
valueTrue/False

Definition at line 189 of file event_manager.cpp.

glm::vec2 hx3d::window::EventManager::getMouseMovement ( )

Get the current mouse movement.

Returns
Mouse movement

Definition at line 161 of file event_manager.cpp.

glm::vec2 hx3d::window::EventManager::getMousePosition ( )

Get the current mouse position.

Returns
Mouse position

Definition at line 157 of file event_manager.cpp.

glm::vec2 hx3d::window::EventManager::getMouseWheelMovement ( )

Get the current mouse wheel movement.

Returns
Mouse wheel movement

Definition at line 165 of file event_manager.cpp.

glm::vec2 hx3d::window::EventManager::getScreenConvertedTouchPosition ( )

Get the screen converted touch position.

Returns
Screen converted touch position

Definition at line 173 of file event_manager.cpp.

glm::vec2 hx3d::window::EventManager::getTouchMovement ( )

Get the current touch movement.

Returns
Touch movement

Definition at line 181 of file event_manager.cpp.

glm::vec2 hx3d::window::EventManager::getTouchPosition ( )

Get the current touch position.

Returns
Touch position

Definition at line 169 of file event_manager.cpp.

float hx3d::window::EventManager::getTouchPressure ( )

Get the current touch pressure.

Returns
Touch pressure

Definition at line 185 of file event_manager.cpp.

bool hx3d::window::EventManager::isKeyJustPressed ( KeyEvent::Key  key)

Test if the key have just been pressed.

Parameters
keyKey
Returns
True/False

Definition at line 139 of file event_manager.cpp.

bool hx3d::window::EventManager::isKeyJustReleased ( KeyEvent::Key  key)

Test if the key have just been released.

Parameters
keyKey
Returns
True/False

Definition at line 148 of file event_manager.cpp.

bool hx3d::window::EventManager::isKeyPressed ( KeyEvent::Key  key)

Test if the key have been pressed.

Parameters
keyKey
Returns
True/False

Definition at line 129 of file event_manager.cpp.

bool hx3d::window::EventManager::isKeyReleased ( KeyEvent::Key  key)

Test if the key have been released.

Parameters
keyKey
Returns
True/False

Definition at line 134 of file event_manager.cpp.

bool hx3d::window::EventManager::isMouseButtonClicked ( MouseButtonEvent::Button  button)

Test if a mouse button have been clicked.

Parameters
buttonButton
Returns
True/False

Definition at line 68 of file event_manager.cpp.

bool hx3d::window::EventManager::isMouseButtonJustClicked ( MouseButtonEvent::Button  button)

Test if a mouse button have just been clicked.

Parameters
buttonButton
Returns
True/False

Definition at line 78 of file event_manager.cpp.

bool hx3d::window::EventManager::isMouseButtonJustReleased ( MouseButtonEvent::Button  button)

Test if a mouse button have just been released.

Parameters
buttonButton
Returns
True/False

Definition at line 87 of file event_manager.cpp.

bool hx3d::window::EventManager::isMouseButtonReleased ( MouseButtonEvent::Button  button)

Test if a mouse button have been relased.

Parameters
buttonButton
Returns
True/False

Definition at line 73 of file event_manager.cpp.

bool hx3d::window::EventManager::isMouseWheelTurned ( MouseWheelEvent::Direction  direction)

Test if the mouse wheel have been turned in a direction.

Parameters
directionDirection
Returns
True/False

Definition at line 96 of file event_manager.cpp.

bool hx3d::window::EventManager::isScreenJustReleased ( )

Test if the screen have been just released.

Returns
True/False

Definition at line 121 of file event_manager.cpp.

bool hx3d::window::EventManager::isScreenJustTouched ( )

Test if the screen have been just touched.

Returns
True/False

Definition at line 113 of file event_manager.cpp.

bool hx3d::window::EventManager::isScreenReleased ( )

Test if the screen have been released.

Returns
True/False

Definition at line 109 of file event_manager.cpp.

bool hx3d::window::EventManager::isScreenTouched ( )

Test if the screen have been touched.

Returns
True/False

Definition at line 105 of file event_manager.cpp.

bool hx3d::window::EventManager::isWindowState ( WindowEvent::Type  type)

Test the window state.

Parameters
typeType
Returns
True/False

Definition at line 59 of file event_manager.cpp.

void hx3d::window::EventManager::setInputHandler ( InputHandler handler)

Define an input handler.

Parameters
handlerInput handler (Raw ptr)

Definition at line 197 of file event_manager.cpp.

void hx3d::window::EventManager::setInputHandler ( Ptr< InputHandler handler)

Define an input handler.

Parameters
handlerInput handler (Ptr)

Definition at line 193 of file event_manager.cpp.


The documentation for this class was generated from the following files: