#include "KeyboardEvent.h"

KeyboardEvent::KeyboardEvent()
    : UiEvent(),
      mAction(),
      mKeyString()
{
    mType = UiEvent::Type::Keyboard;
}

KeyboardEvent::~KeyboardEvent()
{

}

std::unique_ptr<KeyboardEvent> KeyboardEvent::Create()
{
    return std::make_unique<KeyboardEvent>();
}

void KeyboardEvent::setKeyString(const std::string& key)
{
    mKeyString = key;
}

std::string KeyboardEvent::getKeyString() const
{
    return mKeyString;
}

void KeyboardEvent::setAction(Action action)
{
    mAction = action;
}

KeyboardEvent::Action KeyboardEvent::getAction() const
{
    return mAction;
}

bool KeyboardEvent::isFunctionKey() const
{
    return mFunction != Keyboard::Function::UNSET;
}

Keyboard::Function KeyboardEvent::getFunction() const
{
    return mFunction;
}

void KeyboardEvent::setFunction(Keyboard::Function function)
{
    mFunction = function;
}
