1 #ifndef CORE_SYSTEMS_HUD_SCREENKEYBOARD_HPP
2 #define CORE_SYSTEMS_HUD_SCREENKEYBOARD_HPP
4 #include <BLIB/Graphics.hpp>
5 #include <BLIB/Interfaces/Menu.hpp>
6 #include <BLIB/Resources.hpp>
29 using OnSubmit = std::function<void(
const std::string&)>;
50 void start(
unsigned int minLen = 0,
unsigned int maxLen = 16);
65 const std::string&
value()
const;
78 void process(
unsigned int ctrl,
bool ignoreDebounce);
81 bl::engine::Engine& engine;
87 sf::Vector2f position;
88 bl::gfx::Text renderedInput;
89 bl::gfx::Rectangle background;
92 bl::menu::Menu keyboardMenu;
94 void onKeyPress(
char key);
bl::menu::TriggerDriver< Control::MoveUp, Control::MoveRight, Control::MoveDown, Control::MoveLeft, Control::Interact > MenuDriver
Helper typedef for Peoplemon specific menu driving.
Core classes and functionality for both the editor and game.
A screen keyboard for getting arbitrary user input.
std::function< void(const std::string &)> OnSubmit
sf::Vector2f getSize() const
Returns the size of the screen keyboard.
void start(unsigned int minLen=0, unsigned int maxLen=16)
Subscribes the keyboard to the event bus.
void process(unsigned int ctrl, bool ignoreDebounce)
Handles player input.
void setPosition(const sf::Vector2f &position)
Sets the position of the keyboard. The default is (??)
void stop()
Unsubscribes the keyboard from the event bus.
ScreenKeyboard(bl::engine::Engine &engine, const OnSubmit &onSubmit)
Construct a new Screen Keyboard.
~ScreenKeyboard()
Unsubscribes the keyboard if still subscribed.
const std::string & value() const
Returns the current input value.