| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

Public Types | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes
Fling::Input Class Referenceabstract

Base input class for polling input in the Fling Engine. More...

`#include <Input.h>`

Inherits Fling::NonCopyable.

## Public Types
typedef std::map< std::string, Fling::Key > | KeyMap
| Input Key mappings. More...
typedef std::pair< std::string, Fling::Key > | KeyPair
typedef std::map< std::string, entt::delegate< void()> > | KeyDownMap
| Key press delegate mappings. More...
typedef std::pair< std::string, entt::delegate< void()> > | KeyDownMapPair

## Static Public Member Functions
static void | Init ()
| Initialize the input instance on this platform. More...
static void | PreUpdate ()
| PreUpdate is called before polling of input, and after Init. More...
static void | Shutdown ()
| Shuts down input manager. More...
static void | Poll ()
| Update any input polling that needs to happen on this platform. More...
static bool | IsKeyDown (const std::string &t_KeyName)
static bool | IsKeyHeld (const std::string &t_KeyName)
static bool | IsMouseButtonPressed (const std::string &t_KeyName)
static bool | IsMouseDown (const std::string &t_KeyName)
static MousePos | GetMousePos ()
| Get the current mouse position in screen space. More...
template<auto Candidate, typename Type >
static void | BindKeyPress (const std::string &t_KeyName, Type &t_Instance)
| Bind a callback function to when a key is pressed. More...

## Protected Member Functions
virtual void | InitImpl ()=0
virtual void | PreUpdateImpl ()=0
virtual void | ShutdownImpl ()=0
virtual void | PollImpl ()=0
| Poll for input from the keyboard. More...
virtual void | InitKeyMap ()=0
virtual bool | IsKeyDownImpl (const std::string &t_KeyName)=0
virtual bool | IsKeyHelpImpl (const std::string &t_KeyName)=0
virtual bool | IsMouseButtonPressedImpl (const std::string &t_KeyName)=0
virtual bool | IsMouseDownImpl (const std::string &t_KeyName)=0
virtual MousePos | GetMousePosImpl ()=0
Protected Member Functions inherited from Fling::NonCopyable
| NonCopyable ()=default
virtual | ~NonCopyable ()=default

## Static Protected Member Functions
static void | AddKeyMap (const std::string &t_Name, UINT32 t_KeyCode)
| Add a key mapping to this platform. More...

## Static Protected Attributes
static KeyMap | m_KeyMap
| The actual key map. More...
static KeyDownMap | m_KeyDownMap
static Input * | m_Instance
| Created by the implementation class. More...

## Additional Inherited Members
Public Member Functions inherited from Fling::NonCopyable
| NonCopyable (const NonCopyable &)=delete
| NonCopyable (NonCopyable &&)=default
NonCopyable & | operator= (const NonCopyable &)=delete
NonCopyable & | operator= (NonCopyable &&)=default

## Detailed Description

Base input class for polling input in the Fling Engine.

## Member Typedef Documentation

## ◆ KeyDownMap

typedef std::map<std::string, entt::delegate<void()> > Fling::Input::KeyDownMap

Key press delegate mappings.

## ◆ KeyDownMapPair

typedef std::pair<std::string, entt::delegate<void()> > Fling::Input::KeyDownMapPair

## ◆ KeyMap

typedef std::map<std::string, Fling::Key> Fling::Input::KeyMap

Input Key mappings.

## ◆ KeyPair

typedef std::pair<std::string, Fling::Key> Fling::Input::KeyPair

## Member Function Documentation

## ◆ AddKeyMap()

static void Fling::Input::AddKeyMap | ( | const std::string & | t_Name,
|  | UINT32 | t_KeyCode
| ) |  |
| inline static protected

Add a key mapping to this platform.

Parameters

  t_Name | The name of this key
  t_KeyCode | The KeyCode that maps this key to the current platform

## ◆ BindKeyPress()

template<auto Candidate, typename Type >

void Fling::Input::BindKeyPress | ( | const std::string & | t_KeyName,
|  | Type & | t_Instance
| ) |  |
| static

Bind a callback function to when a key is pressed.

Template Parameters

  Candidate | The function that you would like to bind

Parameters

  t_KeyName | Key name to bind to
  t_Instance | The instance of the object you are binding to

See also
  https://github.com/skypjack/entt/wiki/Crash-Course:-events,-signals-and-everything-in-between#delegate
  Fling::KeyNames

## ◆ GetMousePos()

static MousePos Fling::Input::GetMousePos | ( |  | ) |
| inline static

Get the current mouse position in screen space.

## ◆ GetMousePosImpl()

virtual MousePos Fling::Input::GetMousePosImpl | ( |  | ) |
| protected pure virtual

## ◆ Init()

static void Fling::Input::Init | ( |  | ) |
| inline static

Initialize the input instance on this platform.

Handle and input mapping on this platform

## ◆ InitImpl()

virtual void Fling::Input::InitImpl | ( |  | ) |
| protected pure virtual

## ◆ InitKeyMap()

virtual void Fling::Input::InitKeyMap | ( |  | ) |
| protected pure virtual

## ◆ IsKeyDown()

static bool Fling::Input::IsKeyDown | ( | const std::string & | t_KeyName | ) |
| inline static

## ◆ IsKeyDownImpl()

virtual bool Fling::Input::IsKeyDownImpl | ( | const std::string & | t_KeyName | ) |
| protected pure virtual

## ◆ IsKeyHeld()

static bool Fling::Input::IsKeyHeld | ( | const std::string & | t_KeyName | ) |
| inline static

## ◆ IsKeyHelpImpl()

virtual bool Fling::Input::IsKeyHelpImpl | ( | const std::string & | t_KeyName | ) |
| protected pure virtual

## ◆ IsMouseButtonPressed()

static bool Fling::Input::IsMouseButtonPressed | ( | const std::string & | t_KeyName | ) |
| inline static

## ◆ IsMouseButtonPressedImpl()

virtual bool Fling::Input::IsMouseButtonPressedImpl | ( | const std::string & | t_KeyName | ) |
| protected pure virtual

## ◆ IsMouseDown()

static bool Fling::Input::IsMouseDown | ( | const std::string & | t_KeyName | ) |
| inline static

## ◆ IsMouseDownImpl()

virtual bool Fling::Input::IsMouseDownImpl | ( | const std::string & | t_KeyName | ) |
| protected pure virtual

## ◆ Poll()

static void Fling::Input::Poll | ( |  | ) |
| inline static

Update any input polling that needs to happen on this platform.

## ◆ PollImpl()

virtual void Fling::Input::PollImpl | ( |  | ) |
| protected pure virtual

Poll for input from the keyboard.

## ◆ PreUpdate()

static void Fling::Input::PreUpdate | ( |  | ) |
| inline static

PreUpdate is called before polling of input, and after Init.

Useful for anything that needs to happen after Window creation.

## ◆ PreUpdateImpl()

virtual void Fling::Input::PreUpdateImpl | ( |  | ) |
| protected pure virtual

## ◆ Shutdown()

static void Fling::Input::Shutdown | ( |  | ) |
| inline static

Shuts down input manager.

Deletes the input implementation pointer.

## ◆ ShutdownImpl()

virtual void Fling::Input::ShutdownImpl | ( |  | ) |
| protected pure virtual

## Field Documentation

## ◆ m_Instance

Input* Fling::Input::m_Instance
| static protected

Created by the implementation class.

See also
  WindowInput

## ◆ m_KeyDownMap

KeyDownMap Fling::Input::m_KeyDownMap
| static protected

## ◆ m_KeyMap

KeyMap Fling::Input::m_KeyMap
| static protected

The actual key map.

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

- FlingEngine/Core/inc/Input/Input.h
- FlingEngine/Core/inc/Input/Input.inl