nomlib
Loading...
Searching...
No Matches
nom::UIContextEventHandler Class Reference

The default event handler interface for a nom::UIContext. More...

#include <UIContextEventHandler.hpp>

Inheritance diagram for nom::UIContextEventHandler:
[legend]

Public Types

typedef UIContextEventHandler self_type
typedef self_type * raw_ptr
Public Types inherited from nom::IUIEventHandler
typedef IUIEventHandler self_type
typedef self_type * raw_ptr

Public Member Functions

 UIContextEventHandler (UIContext *ctx)
 Default constructor.
virtual ~UIContextEventHandler ()
 Destructor.
virtual void process_event (const nom::Event &ev)
 Injection of libRocket's event loop.
Public Member Functions inherited from nom::IUIEventHandler
 IUIEventHandler ()
 Default constructor.
virtual ~IUIEventHandler ()
 Destructor.

Protected Member Functions

virtual Rocket::Core::Input::KeyIdentifier translate_key (const Event &ev)
virtual int translate_mouse_button (const Event &ev)
virtual int translate_mouse_wheel (const Event &ev)
virtual int translate_key_modifiers (const Event &ev)

Private Attributes

UIContextctx_

Detailed Description

The default event handler interface for a nom::UIContext.

Definition at line 44 of file UIContextEventHandler.hpp.

Member Typedef Documentation

◆ raw_ptr

typedef self_type* nom::UIContextEventHandler::raw_ptr

Definition at line 48 of file UIContextEventHandler.hpp.

◆ self_type

typedef UIContextEventHandler nom::UIContextEventHandler::self_type

Definition at line 47 of file UIContextEventHandler.hpp.

Constructor & Destructor Documentation

◆ UIContextEventHandler()

nom::UIContextEventHandler::UIContextEventHandler ( UIContext * ctx)

Default constructor.

\params ctx An object pointer to the context utilizing this instance.

Member Function Documentation

◆ process_event()

virtual void nom::UIContextEventHandler::process_event ( const nom::Event & ev)
virtual

Injection of libRocket's event loop.

Remarks
Implements IUIEventHandler::process_event.

Implements nom::IUIEventHandler.

◆ translate_mouse_wheel()

virtual int nom::UIContextEventHandler::translate_mouse_wheel ( const Event & ev)
protectedvirtual
Returns
Positive X, Y axis wheel values are translated from SDL2 to libRocket as the 'up' direction in libRocket and negative X, Y axis wheel values are translated to libRocket as the 'down' direction.
Remarks
libRocket uses negative wheel values as the 'up' direction (away from the end-user), and positive wheel values as the 'down' direction (towards the end-user). This is indeed the inverse of how SDL2 handles the values.

Member Data Documentation

◆ ctx_

UIContext* nom::UIContextEventHandler::ctx_
private

Definition at line 80 of file UIContextEventHandler.hpp.


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