Danbias/Code/Misc/Input/Source/ApplicationKeyboard.cpp

44 lines
759 B
C++
Raw Normal View History

2014-02-20 13:27:21 +01:00
#include "../Include/ApplicationKeyboard.h"
using namespace ::Input;
ApplicationKeyboard::ApplicationKeyboard() :
InputObject( Enum::SAIType_ApplicationKeyboard )
{
this->textTarget = nullptr;
this->writePos = 0;
2014-02-20 13:27:21 +01:00
this->isEnabled = true;
}
ApplicationKeyboard::~ApplicationKeyboard()
{ /* DO nothing */ }
bool ApplicationKeyboard::IsActive() const
{
return this->isEnabled;
}
void ApplicationKeyboard::Activate()
{
this->isEnabled = true;
}
void ApplicationKeyboard::Deactivate()
{
this->isEnabled = false;
}
void ApplicationKeyboard::BindTextTarget( ::std::wstring *field )
2014-02-20 13:27:21 +01:00
{
this->textTarget = field;
if( field )
{
this->writePos = field->size();
}
}
void ApplicationKeyboard::ReleaseTextTarget( )
{
this->BindTextTarget( nullptr );
2014-02-20 13:27:21 +01:00
}