Copperfield Engine 0.1
C++ Game Engine
Loading...
Searching...
No Matches
input.hpp File Reference

Input management. More...

Go to the source code of this file.

Classes

class  InputManager
 Interface to retrieve keyboard and mouse input. More...
 

Typedefs

using InputButtonMap = std::unordered_map< std::string, std::vector< InputButton > >
 Structure that binds user-created actions and physical input. More...
 

Enumerations

enum class  CursorMode { Normal , Hidden , Disabled }
 Define cursor and mouse behaviors. More...
 
enum class  InputButton
 Allowed keyboard and mouse buttons.
 

Detailed Description

Input management.

Typedef Documentation

◆ InputButtonMap

using InputButtonMap = std::unordered_map<std::string, std::vector<InputButton> >

Structure that binds user-created actions and physical input.

Can be initialized as an array where each value contains a string and a vector of InputButton.
Example:

InputButtonMap inputMap{
{"Up", {InputButton::W, InputButton::DOWN}},
{"Down", {InputButton::S}},
{"Left", {InputButton::A}},
{"Right", {InputButton::D}},
}
std::unordered_map< std::string, std::vector< InputButton > > InputButtonMap
Structure that binds user-created actions and physical input.
Definition: input.hpp:175

Enumeration Type Documentation

◆ CursorMode

enum class CursorMode
strong

Define cursor and mouse behaviors.

Enumerator
Normal 

Show the cursor.

Hidden 

The cursor is not displayed but behaves as if it were there.

Disabled 

The window locks the cursor inside it and hides it, allowing you to infinitely move the mouse without exiting the window.