2014-02-20 13:27:21 +01:00
|
|
|
#include "../Include/ApplicationKeyboard.h"
|
|
|
|
|
|
|
|
using namespace ::Input;
|
|
|
|
|
|
|
|
ApplicationKeyboard::ApplicationKeyboard() :
|
|
|
|
InputObject( Enum::SAIType_ApplicationKeyboard )
|
|
|
|
{
|
2014-02-20 14:39:12 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2014-02-20 14:39:12 +01:00
|
|
|
void ApplicationKeyboard::BindTextTarget( ::std::wstring *field )
|
2014-02-20 13:27:21 +01:00
|
|
|
{
|
2014-02-20 14:39:12 +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
|
|
|
}
|