#pragma once

#include <memory>
#include <string>

#include "UiEvent.h"
#include "Keyboard.h"

class KeyboardEvent : public UiEvent
{
public:
    enum class Action
    {
        Pressed,
        Released
    };

public:

    KeyboardEvent();

    ~KeyboardEvent();

    static std::unique_ptr<KeyboardEvent> Create();

    void setKeyString(const std::string& key);

    std::string getKeyString() const;

    void setAction(Action action);

    Action getAction() const;

    bool isFunctionKey() const;

    Keyboard::Function getFunction() const;

    void setFunction(Keyboard::Function function);

private:

    Keyboard::Function mFunction{Keyboard::Function::UNSET};
    Action mAction;
    std::string mKeyString;

};
using KeyboardEventUPtr = std::unique_ptr<KeyboardEvent>;
