aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2015-10-24 12:04:08 +0200
committerMartijn Kaijser <martijn@xbmc.org>2015-10-24 12:04:08 +0200
commitc464602a37104d73403488855f981a7b03011457 (patch)
treef41a830c490182957907e4cf62c0825cae761e33
parent9a517d9cc891852260243cea3eff7b6608f351f5 (diff)
parentee48b96f213482759cb4c2e5514ded87cc7d10fb (diff)
Merge pull request #8266 from sportica/fix_sms_t9_after_pr7952
Revert to process action without unicode. #16329
-rw-r--r--xbmc/dialogs/GUIDialogKeyboardGeneric.cpp57
1 files changed, 28 insertions, 29 deletions
diff --git a/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp b/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
index e49c83946a..8c943bda03 100644
--- a/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
+++ b/xbmc/dialogs/GUIDialogKeyboardGeneric.cpp
@@ -194,37 +194,32 @@ bool CGUIDialogKeyboardGeneric::OnAction(const CAction &action)
handled = false;
else
{
- handled = false;
- wchar_t unicode = action.GetUnicode();
- if (unicode)
+ std::wstring wch = L"";
+ wch.insert(wch.begin(), action.GetUnicode());
+ std::string ch;
+ g_charsetConverter.wToUTF8(wch, ch);
+ handled = CodingCharacter(ch);
+ if (!handled)
{
- std::wstring wch = L"";
- wch.insert(wch.begin(), unicode);
- std::string ch;
- g_charsetConverter.wToUTF8(wch, ch);
- handled = CodingCharacter(ch);
- if (!handled)
+ // send action to edit control
+ CGUIControl *edit = GetControl(CTL_EDIT);
+ if (edit)
+ handled = edit->OnAction(action);
+ if (!handled && action.GetID() >= KEY_VKEY && action.GetID() < KEY_ASCII)
{
- // send action to edit control
- CGUIControl *edit = GetControl(CTL_EDIT);
- if (edit)
- handled = edit->OnAction(action);
- if (!handled && action.GetID() >= KEY_VKEY && action.GetID() < KEY_ASCII)
+ BYTE b = action.GetID() & 0xFF;
+ if (b == XBMCVK_TAB)
{
- BYTE b = action.GetID() & 0xFF;
- if (b == XBMCVK_TAB)
+ // Toggle left/right key mode
+ m_isKeyboardNavigationMode = !m_isKeyboardNavigationMode;
+ if (m_isKeyboardNavigationMode)
{
- // Toggle left/right key mode
- m_isKeyboardNavigationMode = !m_isKeyboardNavigationMode;
- if (m_isKeyboardNavigationMode)
- {
- m_previouslyFocusedButton = GetFocusedControlID();
- SET_CONTROL_FOCUS(edit->GetID(), 0);
- }
- else
- SET_CONTROL_FOCUS(m_previouslyFocusedButton, 0);
- handled = true;
+ m_previouslyFocusedButton = GetFocusedControlID();
+ SET_CONTROL_FOCUS(edit->GetID(), 0);
}
+ else
+ SET_CONTROL_FOCUS(m_previouslyFocusedButton, 0);
+ handled = true;
}
}
}
@@ -717,9 +712,13 @@ bool CGUIDialogKeyboardGeneric::CodingCharacter(const std::string &ch)
switch (m_codingtable->GetType())
{
case IInputCodingTable::TYPE_CONVERT_STRING:
- m_hzcode += ch;
- SetEditText(m_codingtable->ConvertString(m_hzcode));
- return true;
+ if (!ch.empty() && ch[0] != 0)
+ {
+ m_hzcode += ch;
+ SetEditText(m_codingtable->ConvertString(m_hzcode));
+ return true;
+ }
+ break;
case IInputCodingTable::TYPE_WORD_LIST:
if (m_codingtable->GetCodeChars().find(ch) != std::string::npos)