File SDLInputListener.h

namespace Gsage
class SDLInputFactory : public AbstractInputFactory

Public Functions

SDLInputFactory()
virtual ~SDLInputFactory()
InputHandlerPtr create(size_t windowHandle, Engine *engine)

Create SDL input handler

Return

InputHandler

Parameters
  • windowHandle: Window handle to attach to

  • engine: Engine instance

void setSDLCore(SDLCore *core)

Inject SDL core instance

Parameters
  • core: SDL core

Private Members

SDLCore *mCore
InputHandlerPtr mListener
class SDLInputListener : public InputHandler, public EventDispatcher, public Gsage::SDLEventListener

Public Functions

SDLInputListener(size_t handle, Engine *eventRedirect = 0)
virtual ~SDLInputListener()
void handleEvent(SDL_Event *event)

Handle sdl event

Parameters
  • event: SDL event

virtual void update(double time)
virtual void handleResize(unsigned int width, unsigned int height)
virtual void handleClose()

Private Functions

const MouseEvent::ButtonType mapButtonType(Uint8 sdlButtonID)
void handleMouseEvent(SDL_Event *event)

Handle mouse event

Parameters
  • event: SDL_Event

void handleKeyboardEvent(SDL_Event *event)

Handle keyboard event

Parameters
  • event: SDL_Event

Private Members

std::map<SDL_Keycode, KeyboardEvent::Key> mKeyMap