From a611ef3d50dac090bfe2be379774e2d5995b7e41 Mon Sep 17 00:00:00 2001 From: Krzysztof Dermont Date: Wed, 10 Feb 2016 17:03:37 +0100 Subject: [PATCH] Fix issue #711 Update text input handling based on focus event --- src/ui/controls/edit.cpp | 12 ++++++++++-- src/ui/controls/edit.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ui/controls/edit.cpp b/src/ui/controls/edit.cpp index 1d55624c..4bbdc26a 100644 --- a/src/ui/controls/edit.cpp +++ b/src/ui/controls/edit.cpp @@ -484,10 +484,12 @@ bool CEdit::EventProcess(const Event &event) if ( event.customParam == m_eventType ) { m_bFocus = true; + UpdateFocus(); } else { m_bFocus = false; + UpdateFocus(); } } @@ -504,10 +506,12 @@ bool CEdit::EventProcess(const Event &event) if ( m_bEdit || m_bHilite ) m_bCapture = true; } m_bFocus = true; + UpdateFocus(); } else { m_bFocus = false; + UpdateFocus(); } } @@ -3229,9 +3233,13 @@ void CEdit::SetFocus(CControl* control) if (oldFocus != m_bFocus) { - // Start/stop text input mode, this toggles the on-screen keyboard - CApplication::GetInstancePointer()->SetTextInput(m_bFocus); + UpdateFocus(); } } +void CEdit::UpdateFocus() +{ + CApplication::GetInstancePointer()->SetTextInput(m_bFocus); } + +} \ No newline at end of file diff --git a/src/ui/controls/edit.h b/src/ui/controls/edit.h index 87112951..e4f1e7f7 100644 --- a/src/ui/controls/edit.h +++ b/src/ui/controls/edit.h @@ -228,6 +228,7 @@ protected: void UpdateScroll(); void SetFocus(CControl* control) override; + void UpdateFocus(); // Start/stop text input mode, this toggles the on-screen keyboard protected: std::unique_ptr m_scroll; // vertical scrollbar on the right