mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
Add text input on mobile
This commit is contained in:
@@ -32,6 +32,8 @@ namespace PortabilityLayer
|
||||
virtual bool IsUsingMouseAsTouch() const = 0;
|
||||
virtual bool IsTextInputObstructive() const = 0;
|
||||
virtual unsigned int GetCPUCount() const = 0;
|
||||
virtual void SetTextInputEnabled(bool isEnabled) = 0;
|
||||
virtual bool IsTextInputEnabled() const = 0;
|
||||
|
||||
static void SetInstance(HostSystemServices *instance);
|
||||
static HostSystemServices *GetInstance();
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "FontFamily.h"
|
||||
#include "FontManager.h"
|
||||
#include "HostSystemServices.h"
|
||||
#include "InputManager.h"
|
||||
#include "MacRomanConversion.h"
|
||||
#include "MemoryManager.h"
|
||||
@@ -42,6 +43,9 @@ namespace PortabilityLayer
|
||||
|
||||
EditboxWidget::~EditboxWidget()
|
||||
{
|
||||
if (m_hasFocus)
|
||||
PortabilityLayer::HostSystemServices::GetInstance()->SetTextInputEnabled(false);
|
||||
|
||||
PortabilityLayer::MemoryManager *mm = PortabilityLayer::MemoryManager::GetInstance();
|
||||
|
||||
if (m_chars)
|
||||
@@ -155,10 +159,15 @@ namespace PortabilityLayer
|
||||
DrawSurface *surface = m_window->GetDrawSurface();
|
||||
DrawControl(surface);
|
||||
}
|
||||
|
||||
PortabilityLayer::HostSystemServices::GetInstance()->SetTextInputEnabled(true);
|
||||
}
|
||||
|
||||
void EditboxWidget::LoseFocus()
|
||||
{
|
||||
if (m_hasFocus)
|
||||
PortabilityLayer::HostSystemServices::GetInstance()->SetTextInputEnabled(false);
|
||||
|
||||
m_hasFocus = false;
|
||||
m_selStartChar = 0;
|
||||
m_selEndChar = 0;
|
||||
|
Reference in New Issue
Block a user