Class InputManager

Page Contents

Class Documentation

class InputManager

Scene Manager. You can get it from Engine.

See
Engine.

Public Functions

void registerAction(const std::string &action, const sf::Keyboard::Key keyboardKey)

Attach Action to keyboard button.

Parameters
  • actionName: - name of action.
  • keyboardKey: - keyboard key from SFML.

void registerAction(const std::string &action, const sf::Mouse::Button mouseButton)

Attach Action to mouse button.

Parameters
  • actionName: - name of action.
  • keyboardKey: - mouse button from SFML.

void unregisterAction(const std::string &action)

Remove Action.

Parameters
  • actionName: - name of action.

bool isActionPressed(const std::string &action) const

Check if action is pressed or not.

Return
true - if action is pressed.
Return
false - if action is not pressed.
Parameters
  • action: - action to check.

sf::Vector2i getMousePosition(const sf::Window &relativeTo) const

Get the current position of the mouse in window coordinates. This function returns the current position of the mouse cursor, relative to the given window.

Return
Current position of the mouse.
Parameters
  • relativeTo: - Coordinates from window.