Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
jop::WindowEventHandler Class Referenceabstract

#include <WindowEventHandler.hpp>

Public Member Functions

 WindowEventHandler (Window &windowRef)
 Constructor. More...
 
virtual ~WindowEventHandler ()=0
 Virtual destructor. More...
 
virtual void closed ()
 Close callback. More...
 
virtual void resized (const unsigned int x, const unsigned int y)
 Resize callback. More...
 
virtual void lostFocus ()
 Focus lost callback. More...
 
virtual void gainedFocus ()
 Gained focus callback. More...
 
virtual void keyPressed (const int key, const int scanCode, const int mods)
 Key pressed callback. More...
 
virtual void keyReleased (const int key, const int scanCode, const int mods)
 Key released callback. More...
 
virtual void textEntered (const unsigned int code)
 Text entered callback. More...
 
virtual void mouseMoved (const float x, const float y)
 Mouse moved callback. More...
 
virtual void mouseMovedAbsolute (const float x, const float y)
 Mouse position callback. More...
 
virtual void mouseButtonPressed (const int button, const int mods)
 Mouse button pressed callback. More...
 
virtual void mouseButtonReleased (const int button, const int mods)
 Mouse button released callback. More...
 
virtual void mouseLeft ()
 Mouse left callback. More...
 
virtual void mouseEntered ()
 Mouse entered callback. More...
 
virtual void mouseScrolled (const float x, const float y)
 Mouse scrolled callback. More...
 
virtual void controllerConnected (const int index, const std::string &name)
 Controller connected callback. More...
 
virtual void controllerDisconnected (const int index)
 Controller disconnected callback. More...
 
virtual void controllerAxisShifted (const int index, const int axisIndex, const float shift)
 Controller axis callback. More...
 
virtual void controllerButtonPressed (const int index, const int button)
 Controller button pressed callback. More...
 
virtual void controllerButtonReleased (const int index, const int button)
 Controller button released callback. More...
 
virtual void touchPressed (const int touchId, const float x, const float y)
 Touch pressed callback. More...
 
virtual void touchReleased (const int touchId, const float x, const float y)
 Touch released callback. More...
 
virtual void touchMoved (const int touchId, const float x, const float y)
 Touch moved callback. More...
 
virtual void touchMovedAbsolute (const int touchId, const float x, const float y)
 Touch moved callback. More...
 
virtual void touchInfo (const int touchId, const int info, const float value)
 Touch event information callback. More...
 
virtual void touchScrolled (const float x, const float y)
 Touch scrolled callback. More...
 

Public Attributes

float m_lastMouseX
 For internal use. Do not touch. More...
 
float m_lastMouseY
 For internal use. Do not touch. More...
 

Protected Attributes

Windowm_windowRef
 Reference to the window. More...
 

Friends

class Window
 

Detailed Description

Definition at line 38 of file WindowEventHandler.hpp.

Constructor & Destructor Documentation

jop::WindowEventHandler::WindowEventHandler ( Window windowRef)

Constructor.

Parameters
windowRefReference to the window this handler will be bound to
virtual jop::WindowEventHandler::~WindowEventHandler ( )
pure virtual

Virtual destructor.

Member Function Documentation

virtual void jop::WindowEventHandler::closed ( )
virtual

Close callback.

This will be called if the window was requested to be closed.

virtual void jop::WindowEventHandler::controllerAxisShifted ( const int  index,
const int  axisIndex,
const float  shift 
)
virtual

Controller axis callback.

Parameters
indexIndex of the controller
axisIndexIndex of the axis
shiftShift of the axis, between -1 and 1
See also
Controller::XBox::Axis
virtual void jop::WindowEventHandler::controllerButtonPressed ( const int  index,
const int  button 
)
virtual

Controller button pressed callback.

Parameters
indexIndex of the controller
buttonThe controller button
See also
Controller::XBox::Button
virtual void jop::WindowEventHandler::controllerButtonReleased ( const int  index,
const int  button 
)
virtual

Controller button released callback.

Parameters
indexIndex of the controller
buttonThe controller button
See also
Controller::XBox::Button
virtual void jop::WindowEventHandler::controllerConnected ( const int  index,
const std::string &  name 
)
virtual

Controller connected callback.

This will be called when a controller or a joystick is connected.

Parameters
indexIndex of the new controller
nameName of the controller
virtual void jop::WindowEventHandler::controllerDisconnected ( const int  index)
virtual

Controller disconnected callback.

Parameters
indexIndex of the controller
virtual void jop::WindowEventHandler::gainedFocus ( )
virtual

Gained focus callback.

This will be called when the window gains focus or is restored.

virtual void jop::WindowEventHandler::keyPressed ( const int  key,
const int  scanCode,
const int  mods 
)
virtual

Key pressed callback.

This will be called when a keyboard key is pressed.

Parameters
keyThe key that was pressed
scanCodeThe scan code
modsModifiers
See also
Keyboard::Key
Keyboard::Modifier
virtual void jop::WindowEventHandler::keyReleased ( const int  key,
const int  scanCode,
const int  mods 
)
virtual

Key released callback.

This will be called when a keyboard key is released.

Parameters
keyThe key that was released
scanCodeThe scan code
modsModifiers
See also
Keyboard::Key
Keyboard::Modifier
virtual void jop::WindowEventHandler::lostFocus ( )
virtual

Focus lost callback.

This will be called when the window loses focus or is minimized.

virtual void jop::WindowEventHandler::mouseButtonPressed ( const int  button,
const int  mods 
)
virtual

Mouse button pressed callback.

This will be called when one of the mouse buttons is pressed.

Parameters
buttonThe mouse button
modsModifiers
See also
Mouse::Button
Keyboard::Modifier
virtual void jop::WindowEventHandler::mouseButtonReleased ( const int  button,
const int  mods 
)
virtual

Mouse button released callback.

This will be called when one of the mouse buttons is released.

Parameters
buttonThe mouse button
modsModifiers
See also
Mouse::Button
Keyboard::Modifier
virtual void jop::WindowEventHandler::mouseEntered ( )
virtual

Mouse entered callback.

This will be called when the mouse cursor enters the window. On Android this means that the application gained input focus.

virtual void jop::WindowEventHandler::mouseLeft ( )
virtual

Mouse left callback.

This will be called when the mouse cursor leaves the window. On Android this means that the application lost input focus.

virtual void jop::WindowEventHandler::mouseMoved ( const float  x,
const float  y 
)
virtual

Mouse moved callback.

This will be called when the mouse is moved.

Parameters
xThe vertical offset
yThe horizontal offset
virtual void jop::WindowEventHandler::mouseMovedAbsolute ( const float  x,
const float  y 
)
virtual

Mouse position callback.

This will be called when the mouse is moved.

Parameters
xThe vertical position
yThe horizontal position
virtual void jop::WindowEventHandler::mouseScrolled ( const float  x,
const float  y 
)
virtual

Mouse scrolled callback.

This will be called when the mouse wheel is scrolled.

Parameters
xThe vertical offset
yThe horizontal offset
virtual void jop::WindowEventHandler::resized ( const unsigned int  x,
const unsigned int  y 
)
virtual

Resize callback.

This will be called when the window frame buffer size has changed.

Parameters
xThe new width
yThe new height
virtual void jop::WindowEventHandler::textEntered ( const unsigned int  code)
virtual

Text entered callback.

This will produce an unicode code point whenever text is entered.

Parameters
codeThe character code point
virtual void jop::WindowEventHandler::touchInfo ( const int  touchId,
const int  info,
const float  value 
)
virtual

Touch event information callback.

Parameters
touchIdId for finger in case of multiple touches
infoEnum value of information
valuePressure or radius of touch
See also
Touch::Info
virtual void jop::WindowEventHandler::touchMoved ( const int  touchId,
const float  x,
const float  y 
)
virtual

Touch moved callback.

This will be called when touch isn't stationary.

Parameters
touchIdId for finger in case of multiple touches
xThe vertical offset
yThe horizontal offset
virtual void jop::WindowEventHandler::touchMovedAbsolute ( const int  touchId,
const float  x,
const float  y 
)
virtual

Touch moved callback.

This will be called when touch isn't stationary.

Parameters
touchIdId for finger in case of multiple touches
xThe vertical offset
yThe horizontal offset
touchIdId for finger in case of multiple touches
xThe vertical position
yThe horizontal position
virtual void jop::WindowEventHandler::touchPressed ( const int  touchId,
const float  x,
const float  y 
)
virtual

Touch pressed callback.

This will be called when touch is started.

Parameters
touchIdId for finger in case of multiple touches
xThe vertical position
yThe horizontal position
virtual void jop::WindowEventHandler::touchReleased ( const int  touchId,
const float  x,
const float  y 
)
virtual

Touch released callback.

This will be called when touch is ended.

Parameters
touchIdId for finger in case of multiple touches
xThe vertical position
yThe horizontal position
virtual void jop::WindowEventHandler::touchScrolled ( const float  x,
const float  y 
)
virtual

Touch scrolled callback.

This will be called when touch has momentum only on one axis.

Parameters
xThe vertical offset
yThe horizontal offset

Friends And Related Function Documentation

friend class Window
friend

Definition at line 44 of file WindowEventHandler.hpp.

Member Data Documentation

float jop::WindowEventHandler::m_lastMouseX

For internal use. Do not touch.

Definition at line 299 of file WindowEventHandler.hpp.

float jop::WindowEventHandler::m_lastMouseY

For internal use. Do not touch.

Definition at line 300 of file WindowEventHandler.hpp.

Window& jop::WindowEventHandler::m_windowRef
protected

Reference to the window.

Definition at line 295 of file WindowEventHandler.hpp.


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