Input - Added method for releasing default input object
This commit is contained in:
parent
1f90de4cb4
commit
18d0a6460b
|
@ -25,6 +25,11 @@ namespace Input
|
|||
*/
|
||||
static InputManager* CreateInputManager ();
|
||||
|
||||
/**
|
||||
* @return Destroy default input manager.
|
||||
*/
|
||||
static void DestroyInputManager ();
|
||||
|
||||
/**
|
||||
* @return Destroys a input manager.
|
||||
*/
|
||||
|
|
|
@ -57,6 +57,11 @@ InputManager* InputManager::CreateInputManager()
|
|||
{
|
||||
return CreateManager();
|
||||
}
|
||||
void InputManager::DestroyInputManager()
|
||||
{
|
||||
delete defaultInstance;
|
||||
defaultInstance = 0;
|
||||
}
|
||||
void InputManager::DestroyInputManager(InputManager* inputSystem)
|
||||
{
|
||||
if(!inputSystem) return;
|
||||
|
@ -77,3 +82,4 @@ InputManager::~InputManager()
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -226,6 +226,10 @@ void Keyboard::BindTextTarget( ::std::wstring *field )
|
|||
{
|
||||
this->writePos = field->size();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->writePos = 0;
|
||||
}
|
||||
}
|
||||
void Keyboard::ReleaseTextTarget( )
|
||||
{
|
||||
|
|
|
@ -150,7 +150,7 @@ Win32Input::Win32Input()
|
|||
{ /*wrong*/ }
|
||||
}
|
||||
Win32Input::~Win32Input()
|
||||
{}
|
||||
{ Destroy(); }
|
||||
InputObject* Win32Input::CreateDevice(const SAIType inputType, Typedefs::WindowHandle targetApplication)
|
||||
{
|
||||
if(!this->instance->targetHwin)
|
||||
|
@ -225,9 +225,7 @@ void Win32Input::ToggleInputSystem(bool enable)
|
|||
void Win32Input::Destroy ()
|
||||
{
|
||||
ShowCursor(true);
|
||||
RECT r;
|
||||
GetWindowRect(GetDesktopWindow(), &r);
|
||||
ClipCursor(&r);
|
||||
ClipCursor(0);
|
||||
|
||||
for (unsigned int i = 0; i < this->keyboard.size(); i++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue