MythTV  master
mythvirtualkeyboard.cpp
Go to the documentation of this file.
1 
2 // Own header
3 #include "mythvirtualkeyboard.h"
4 
5 // c++
6 #include <iostream>
7 
8 // qt
9 #include <QKeyEvent>
10 #include <QDomDocument>
11 #include <QFile>
12 
13 // myth
14 #include "mythmainwindow.h"
15 #include "mythlogging.h"
16 #include "mythfontproperties.h"
17 #include "mythuihelper.h"
18 #include "mythuibutton.h"
19 #include "mythuitextedit.h"
20 #include "mythcorecontext.h"
21 
22 
23 #define LOC QString("MythUIVirtualKeyboard: ")
24 
25 static const std::array<std::array<QString,3>,95> comps {{
26  {"!", "!", (QChar)0xa1}, {"c", "/", (QChar)0xa2},
27  {"l", "-", (QChar)0xa3}, {"o", "x", (QChar)0xa4},
28  {"y", "-", (QChar)0xa5}, {"|", "|", (QChar)0xa6},
29  {"s", "o", (QChar)0xa7}, {"\"", "\"", (QChar)0xa8},
30  {"c", "o", (QChar)0xa9}, {"-", "a", (QChar)0xaa},
31  {"<", "<", (QChar)0xab}, {"-", "|", (QChar)0xac},
32  {"-", "-", (QChar)0xad}, {"r", "o", (QChar)0xae},
33  {"^", "-", (QChar)0xaf}, {"^", "0", (QChar)0xb0},
34  {"+", "-", (QChar)0xb1}, {"^", "2", (QChar)0xb2},
35  {"^", "3", (QChar)0xb3}, {"/", "/", (QChar)0xb4},
36  {"/", "u", (QChar)0xb5}, {"P", "!", (QChar)0xb6},
37  {"^", ".", (QChar)0xb7}, {",", ",", (QChar)0xb8},
38  {"^", "1", (QChar)0xb9}, {"_", "o", (QChar)0xba},
39  {">", ">", (QChar)0xbb}, {"1", "4", (QChar)0xbc},
40  {"1", "2", (QChar)0xbd}, {"3", "4", (QChar)0xbe},
41  {"?", "?", (QChar)0xbf}, {"A", "`", (QChar)0xc0},
42  {"A", "'", (QChar)0xc1}, {"A", "^", (QChar)0xc2},
43  {"A", "~", (QChar)0xc3}, {"A", "\"", (QChar)0xc4},
44  {"A", "*", (QChar)0xc5}, {"A", "E", (QChar)0xc6},
45  {"C", ",", (QChar)0xc7}, {"E", "`", (QChar)0xc8},
46  {"E", "'", (QChar)0xc9}, {"E", "^", (QChar)0xca},
47  {"E", "\"", (QChar)0xcb}, {"I", "`", (QChar)0xcc},
48  {"I", "'", (QChar)0xcd}, {"I", "^", (QChar)0xce},
49  {"I", "\"", (QChar)0xcf}, {"D", "-", (QChar)0xd0},
50  {"N", "~", (QChar)0xd1}, {"O", "`", (QChar)0xd2},
51  {"O", "'", (QChar)0xd3}, {"O", "^", (QChar)0xd4},
52  {"O", "~", (QChar)0xd5}, {"O", "\"", (QChar)0xd6},
53  {"x", "x", (QChar)0xd7}, {"O", "/", (QChar)0xd8},
54  {"U", "`", (QChar)0xd9}, {"U", "'", (QChar)0xda},
55  {"U", "^", (QChar)0xdb}, {"U", "\"", (QChar)0xdc},
56  {"Y", "'", (QChar)0xdd}, {"T", "H", (QChar)0xde},
57  {"s", "s", (QChar)0xdf}, {"a", "`", (QChar)0xe0},
58  {"a", "'", (QChar)0xe1}, {"a", "^", (QChar)0xe2},
59  {"a", "~", (QChar)0xe3}, {"a", "\"", (QChar)0xe4},
60  {"a", "*", (QChar)0xe5}, {"a", "e", (QChar)0xe6},
61  {"c", ",", (QChar)0xe7}, {"e", "`", (QChar)0xe8},
62  {"e", "'", (QChar)0xe9}, {"e", "^", (QChar)0xea},
63  {"e", "\"", (QChar)0xeb}, {"i", "`", (QChar)0xec},
64  {"i", "'", (QChar)0xed}, {"i", "^", (QChar)0xee},
65  {"i", "\"", (QChar)0xef}, {"d", "-", (QChar)0xf0},
66  {"n", "~", (QChar)0xf1}, {"o", "`", (QChar)0xf2},
67  {"o", "'", (QChar)0xf3}, {"o", "^", (QChar)0xf4},
68  {"o", "~", (QChar)0xf5}, {"o", "\"", (QChar)0xf6},
69  {"-", ":", (QChar)0xf7}, {"o", "/", (QChar)0xf8},
70  {"u", "`", (QChar)0xf9}, {"u", "'", (QChar)0xfa},
71  {"u", "^", (QChar)0xfb}, {"u", "\"", (QChar)0xfc},
72  {"y", "'", (QChar)0xfd}, {"t", "h", (QChar)0xfe},
73  {"y", "\"", (QChar)0xff}
74 }};
75 
77  : MythScreenType(parentStack, "MythUIVirtualKeyboard")
78 {
79  m_parentEdit = parentEdit;
80 
81  if (m_parentEdit)
83  else
85 
91 }
92 
94 {
95  if (!LoadWindowFromXML("keyboard/keyboard.xml", "keyboard", this))
96  return false;
97 
99 
101  updateKeys(true);
102 
103  QSize screensize = GetMythUI()->GetScreenSettings().size();
104  MythRect editArea = m_parentEdit->GetArea();
105  MythRect area = GetArea();
106  MythPoint newPos;
107 
108  //FIXME this assumes the edit is a direct child of the parent screen
109  MythUIType *parentScreen = nullptr;
110  parentScreen = qobject_cast<MythUIType *>(m_parentEdit->parent());
111  if (parentScreen)
112  {
113  editArea.moveTopLeft(QPoint(editArea.x() + parentScreen->GetArea().x(),
114  editArea.y() + parentScreen->GetArea().y()));
115  }
116 
117  switch (m_preferredPos)
118  {
119  case VK_POSABOVEEDIT:
120  if (editArea.y() - area.height() - 5 > 0)
121  {
122  newPos = QPoint(editArea.x() + editArea.width() / 2 - area.width() / 2,
123  editArea.y() - area.height() - 5);
124  }
125  else
126  {
127  newPos = QPoint(editArea.x() + editArea.width() / 2 - area.width() / 2,
128  editArea.y() + editArea.height() + 5);
129  }
130  break;
131 
132  case VK_POSTOPDIALOG:
133  newPos = QPoint(screensize.width() / 2 - area.width() / 2, 5);
134  break;
135 
136  case VK_POSBOTTOMDIALOG:
137  newPos = QPoint(screensize.width() / 2 - area.width() / 2, screensize.height() - 5 - area.height());
138  break;
139 
140  case VK_POSCENTERDIALOG:
141  newPos = QPoint(screensize.width() / 2 - area.width() / 2, screensize.height() / 2 - area.height() / 2);
142  break;
143 
144  default:
145  // VK_POSBELOWEDIT
146  if (editArea.y() + editArea.height() + area.height() + 5 < screensize.height())
147  {
148  newPos = QPoint(editArea.x() + editArea.width() / 2 - area.width() / 2,
149  editArea.y() + editArea.height() + 5);
150  }
151  else
152  {
153  newPos = QPoint(editArea.x() + editArea.width() / 2 - area.width() / 2,
154  editArea.y() - area.height() - 5);
155  }
156  break;
157  }
158 
159  // make sure the popup doesn't go off screen
160  if (newPos.x() < 5)
161  newPos.setX(5);
162  if (newPos.x() + area.width() + 5 > screensize.width())
163  newPos.setX(screensize.width() - area.width() - 5);
164  if (newPos.y() < 5)
165  newPos.setY(5);
166  if (newPos.y() + area.height() + 5 > screensize.width())
167  newPos.setY(screensize.width() - area.height() - 5);
168 
169  SetPosition(newPos);
170 
171  return true;
172 }
173 
175 {
176  QString language = lang.toLower();
177 
178  QString defFile = QString("keyboard/%1.xml").arg(language);
179 
180  if (!GetMythUI()->FindThemeFile(defFile))
181  {
182  LOG(VB_GENERAL, LOG_ERR,
183  "No keyboard definition file found for: " + language);
184 
185  // default to US keyboard layout
186  defFile = "keyboard/en_us.xml";
187  if (!GetMythUI()->FindThemeFile(defFile))
188  {
189  LOG(VB_GENERAL, LOG_ERR,
190  "Cannot find definitions file: " + defFile);
191  return;
192  }
193  }
194 
195  LOG(VB_GENERAL, LOG_NOTICE, "Loading definitions from: " + defFile);
196 
197  QDomDocument doc("keydefinitions");
198  QFile file(defFile);
199  if (!file.open(QIODevice::ReadOnly))
200  {
201  LOG(VB_GENERAL, LOG_ERR, "Failed to open definitions file: " + defFile);
202  return;
203  }
204  if (!doc.setContent(&file))
205  {
206  LOG(VB_GENERAL, LOG_ERR,
207  "Failed to parse definitions file: " + defFile);
208  file.close();
209  return;
210  }
211  file.close();
212 
213  QDomElement docElem = doc.documentElement();
214  QDomNode n = docElem.firstChild();
215  while(!n.isNull())
216  {
217  QDomElement e = n.toElement();
218  if(!e.isNull())
219  {
220  if (e.tagName() == "key")
221  parseKey(e);
222  }
223  n = n.nextSibling();
224  }
225 }
226 
227 void MythUIVirtualKeyboard::parseKey(const QDomElement &element)
228 {
229  QString left;
230  QString right;
231  QString up;
232  QString down;
233  QString normal;
234  QString shift;
235  QString alt;
236  QString altshift;
237 
238  QString name = element.attribute("name");
239  QString type = element.attribute("type");
240 
241  QDomNode n = element.firstChild();
242  while(!n.isNull())
243  {
244  QDomElement e = n.toElement();
245  if(!e.isNull())
246  {
247  if (e.tagName() == "move")
248  {
249  left = e.attribute("left");
250  right = e.attribute("right");
251  up = e.attribute("up");
252  down = e.attribute("down");
253  }
254  else if (e.tagName() == "char")
255  {
256  normal = e.attribute("normal");
257  shift = e.attribute("shift");
258  alt = e.attribute("alt");
259  altshift = e.attribute("altshift");
260  }
261  else
262  LOG(VB_GENERAL, LOG_ERR, "Unknown element in key definition");
263  }
264  n = n.nextSibling();
265  }
266 
267  KeyDefinition key;
268  key.name = name;
269  key.type = type;
270  key.left = left;
271  key.right = right;
272  key.up = up;
273  key.down = down;
274  key.normal = decodeChar(normal);
275  key.alt = decodeChar(alt);
276  key.shift = decodeChar(shift);
277  key.altshift = decodeChar(altshift);
278 
279  m_keyMap[name] = key;
280 }
281 
282 void MythUIVirtualKeyboard::updateKeys(bool connectSignals)
283 {
284  QList<MythUIType *> *children = GetAllChildren();
285  for (auto *child : qAsConst(*children))
286  {
287  auto *button = dynamic_cast<MythUIButton *>(child);
288  if (button)
289  {
290  if (m_keyMap.contains(button->objectName()))
291  {
292  KeyDefinition key = m_keyMap.value(button->objectName());
293  button->SetText(getKeyText(key));
294 
295  if (connectSignals)
296  {
297  if (key.type == "shift")
298  {
299  if (!m_shiftLButton)
300  m_shiftLButton = button;
301  else if (!m_shiftRButton)
302  m_shiftRButton = button;
303 
304  button->SetLockable(true);
305  connect(button, SIGNAL(Clicked()), SLOT(shiftClicked()));
306  }
307  else if (key.type == "char")
308  connect(button, SIGNAL(Clicked()), SLOT(charClicked()));
309  else if (key.type == "done")
310  connect(button, SIGNAL(Clicked()), SLOT(returnClicked()));
311  else if (key.type == "del")
312  connect(button, SIGNAL(Clicked()), SLOT(delClicked()));
313  else if (key.type == "lock")
314  {
315  m_lockButton = button;
316  m_lockButton->SetLockable(true);
317  connect(m_lockButton, SIGNAL(Clicked()), SLOT(lockClicked()));
318  }
319  else if (key.type == "alt")
320  {
321  m_altButton = button;
322  m_altButton->SetLockable(true);
323  connect(m_altButton, SIGNAL(Clicked()), SLOT(altClicked()));
324  }
325  else if (key.type == "comp")
326  {
327  m_compButton = button;
328  m_compButton->SetLockable(true);
329  connect(m_compButton, SIGNAL(Clicked()), SLOT(compClicked()));
330  }
331  else if (key.type == "moveleft")
332  connect(button, SIGNAL(Clicked()), SLOT(moveleftClicked()));
333  else if (key.type == "moveright")
334  connect(button, SIGNAL(Clicked()), SLOT(moverightClicked()));
335  else if (key.type == "back")
336  connect(button, SIGNAL(Clicked()), SLOT(backClicked()));
337  }
338  }
339  else
340  {
341  LOG(VB_GENERAL, LOG_WARNING,
342  QString("WARNING - Key '%1' not found in map")
343  .arg(button->objectName()));
344  }
345  }
346  }
347 }
348 
350 {
351  bool handled = false;
352  QStringList actions;
353  handled = GetMythMainWindow()->TranslateKeyPress("TV Frontend", e, actions);
354 
355  if (handled)
356  return true;
357 
358  bool keyFound = false;
359  KeyDefinition key;
360  if (GetFocusWidget())
361  {
362  if (m_keyMap.contains(GetFocusWidget()->objectName()))
363  {
364  key = m_keyMap.value(GetFocusWidget()->objectName());
365  keyFound = true;;
366  }
367  }
368 
369  for (int i = 0; i < actions.size() && !handled; i++)
370  {
371  QString action = actions[i];
372  handled = true;
373 
374  if (action == "UP")
375  {
376  if (keyFound)
377  SetFocusWidget(GetChild(key.up));
378  }
379  else if (action == "DOWN")
380  {
381  if (keyFound)
383  }
384  else if (action == "LEFT")
385  {
386  if (keyFound)
388  }
389  else if (action == "RIGHT")
390  {
391  if (keyFound)
393  }
394  else
395  handled = false;
396  }
397 
398  if (!handled && MythScreenType::keyPressEvent(e))
399  handled = true;
400 
401  return handled;
402 }
403 
405 {
406  if (!GetFocusWidget())
407  return;
408 
409  KeyDefinition key = m_keyMap.value(GetFocusWidget()->objectName());
410  QString c = getKeyText(key);
411 
412  if (m_composing)
413  {
414  if (m_composeStr.isEmpty())
415  m_composeStr = c;
416  else
417  {
418  // Produce the composed key.
419  for (const auto & comp : comps)
420  {
421  if ((m_composeStr == comp[0]) && (c == comp[1]))
422  {
423  c = comp[2];
424 
425  emit keyPressed(c);
426 
427  if (m_parentEdit)
428  {
429  auto *event = new QKeyEvent(QEvent::KeyPress, 0, Qt::NoModifier, c);
430  m_parentEdit->keyPressEvent(event);
431  }
432 
433  break;
434  }
435  }
436 
437  m_composeStr.clear();
438  m_composing = false;
439  if (m_compButton)
440  m_compButton->SetLocked(false);
441  }
442  }
443  else
444  {
445  emit keyPressed(c);
446 
447  if (m_parentEdit)
448  {
449  auto *event = new QKeyEvent(QEvent::KeyPress, 0, Qt::NoModifier, c);
450  m_parentEdit->keyPressEvent(event);
451  }
452 
453  if (m_shift && !m_lock)
454  {
455  m_shift = false;
456  if (m_shiftLButton)
457  m_shiftLButton->SetLocked(false);
458  if (m_shiftRButton)
459  m_shiftRButton->SetLocked(false);
460 
461  updateKeys();
462  }
463  }
464 }
465 
467 {
468  m_shift = !m_shift;
469 
470  if (m_shiftLButton)
472  if (m_shiftRButton)
474  if (m_lockButton && m_lock)
475  {
476  m_lockButton->SetLocked(false);
477  m_lock = false;
478  }
479 
480  updateKeys();
481 }
482 
484 {
485  emit keyPressed("{DELETE}");
486 
487  if (m_parentEdit)
488  {
489  //QKeyEvent *event = new QKeyEvent(QEvent::KeyPress, Qt::Key_Delete, Qt::NoModifier, "");
490  auto *event = new QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier, "");
491  m_parentEdit->keyPressEvent(event);
492  }
493 }
494 
496 {
497  emit keyPressed("{BACK}");
498 
499  if (m_parentEdit)
500  {
501  auto *event = new QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier, "");
502  m_parentEdit->keyPressEvent(event);
503  }
504 }
505 
507 {
508  m_lock = !m_lock;
509  m_shift = m_lock;
510 
511  if (m_shiftLButton)
513  if (m_shiftRButton)
515 
516  updateKeys();
517 }
518 
520 {
521  m_alt = !m_alt;
522 
523  updateKeys();
524 }
525 
527 {
529  m_composeStr.clear();
530 }
531 
533 {
534  if (m_shift)
535  {
536  emit keyPressed("{NEWLINE}");
537  auto *event = new QKeyEvent(QEvent::KeyPress, m_newlineKey.keyCode, m_newlineKey.modifiers, "");
538  m_parentEdit->keyPressEvent(event);
539  }
540  else
541  Close();
542 }
543 
545 {
546  if (m_parentEdit)
547  {
548  if (m_shift)
549  {
550  emit keyPressed("{MOVEUP}");
551  auto *event = new QKeyEvent(QEvent::KeyPress, m_upKey.keyCode, m_upKey.modifiers, "");
552  m_parentEdit->keyPressEvent(event);
553  }
554  else
555  {
556  emit keyPressed("{MOVELEFT}");
557  auto *event = new QKeyEvent(QEvent::KeyPress, m_leftKey.keyCode, m_leftKey.modifiers,"");
558  m_parentEdit->keyPressEvent(event);
559  }
560  }
561 }
562 
564 {
565  if (m_parentEdit)
566  {
567  if (m_shift)
568  {
569  emit keyPressed("{MOVEDOWN}");
570  auto *event = new QKeyEvent(QEvent::KeyPress, m_downKey.keyCode, m_downKey.modifiers, "");
571  m_parentEdit->keyPressEvent(event);
572  }
573  else
574  {
575  emit keyPressed("{MOVERIGHT}");
576  auto *event = new QKeyEvent(QEvent::KeyPress, m_rightKey.keyCode, m_rightKey.modifiers,"");
577  m_parentEdit->keyPressEvent(event);
578  }
579  }
580 }
581 
583 {
584  QString res;
585 
586  while (c.length() > 0)
587  {
588  if (c.startsWith("0x"))
589  {
590  QString sCode = c.left(6);
591  bool bOK = false;
592  short nCode = sCode.toShort(&bOK, 16);
593 
594  c = c.mid(6);
595 
596  if (bOK)
597  {
598  QChar uc(nCode);
599  res += QString(uc);
600  }
601  else
602  LOG(VB_GENERAL, LOG_ERR, QString("bad char code (%1)")
603  .arg(sCode));
604  }
605  else
606  {
607  res += c.leftRef(1);
608  c = c.mid(1);
609  }
610  }
611 
612  return res;
613 }
614 
616 {
617 
618  if (m_shift)
619  {
620  if (m_alt)
621  return key.altshift;
622  return key.shift;
623  }
624 
625  if (m_alt)
626  return key.alt;
627 
628  return key.normal;
629 }
630 
632 {
633  QString keylist = MythMainWindow::GetKey("Global", action);
634 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
635  QStringList keys = keylist.split(',', QString::SkipEmptyParts);
636 #else
637  QStringList keys = keylist.split(',', Qt::SkipEmptyParts);
638 #endif
639  if (keys.empty())
640  return;
641 
642  QKeySequence a(keys[0]);
643  if (a.isEmpty())
644  {
645  LOG(VB_GENERAL, LOG_ERR,
646  QString("loadEventKeyDefinitions bad key (%1)").arg(keys[0]));
647  return;
648  }
649 
650  keyDef->keyCode = a[0];
651 
652  Qt::KeyboardModifiers modifiers = Qt::NoModifier;
653  QStringList parts = keys[0].split('+');
654  for (int j = 0; j < parts.count(); j++)
655  {
656  if (parts[j].toUpper() == "CTRL")
657  modifiers |= Qt::ControlModifier;
658  if (parts[j].toUpper() == "SHIFT")
659  modifiers |= Qt::ShiftModifier;
660  if (parts[j].toUpper() == "ALT")
661  modifiers |= Qt::AltModifier;
662  if (parts[j].toUpper() == "META")
663  modifiers |= Qt::MetaModifier;
664  }
665 
666  keyDef->modifiers = modifiers;
667 }
MythUIVirtualKeyboard::m_leftKey
KeyEventDefinition m_leftKey
Definition: mythvirtualkeyboard.h:95
KeyDefinition::alt
QString alt
Definition: mythvirtualkeyboard.h:22
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1423
MythUIButton::SetLocked
void SetLocked(bool locked)
Definition: mythuibutton.cpp:203
comps
static const std::array< std::array< QString, 3 >, 95 > comps
Definition: mythvirtualkeyboard.cpp:25
KeyEventDefinition
Definition: mythvirtualkeyboard.h:27
MythUIVirtualKeyboard::charClicked
void charClicked(void)
Definition: mythvirtualkeyboard.cpp:404
KeyDefinition::shift
QString shift
Definition: mythvirtualkeyboard.h:22
VK_POSTOPDIALOG
@ VK_POSTOPDIALOG
Definition: mythvirtualkeyboard.h:13
doc
QDomDocument doc("MYTHARCHIVEITEM")
MythUIVirtualKeyboard::loadKeyDefinitions
void loadKeyDefinitions(const QString &lang)
Definition: mythvirtualkeyboard.cpp:174
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
KeyDefinition::normal
QString normal
Definition: mythvirtualkeyboard.h:22
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1106
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:131
MythUIVirtualKeyboard::lockClicked
void lockClicked(void)
Definition: mythvirtualkeyboard.cpp:506
VK_POSBELOWEDIT
@ VK_POSBELOWEDIT
Definition: mythvirtualkeyboard.h:12
MythUIVirtualKeyboard::returnClicked
void returnClicked(void)
Definition: mythvirtualkeyboard.cpp:532
MythUIVirtualKeyboard::compClicked
void compClicked(void)
Definition: mythvirtualkeyboard.cpp:526
MythScreenStack
Definition: mythscreenstack.h:16
arg
arg(title).arg(filename).arg(doDelete))
KeyDefinition::right
QString right
Definition: mythvirtualkeyboard.h:23
KeyDefinition::altshift
QString altshift
Definition: mythvirtualkeyboard.h:22
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:33
MythUIVirtualKeyboard::m_upKey
KeyEventDefinition m_upKey
Definition: mythvirtualkeyboard.h:93
MythUIVirtualKeyboard::shiftClicked
void shiftClicked(void)
Definition: mythvirtualkeyboard.cpp:466
KeyDefinition::down
QString down
Definition: mythvirtualkeyboard.h:23
VK_POSBOTTOMDIALOG
@ VK_POSBOTTOMDIALOG
Definition: mythvirtualkeyboard.h:14
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythUIButton::SetLockable
void SetLockable(bool lockable)
Definition: mythuibutton.h:39
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythUIType::GetAllChildren
QList< MythUIType * > * GetAllChildren(void)
Return a list of all child widgets.
Definition: mythuitype.cpp:195
MythUIVirtualKeyboard::loadEventKeyDefinitions
static void loadEventKeyDefinitions(KeyEventDefinition *keyDef, const QString &action)
Definition: mythvirtualkeyboard.cpp:631
build_compdb.file
file
Definition: build_compdb.py:55
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:18
MythUIVirtualKeyboard::backClicked
void backClicked(void)
Definition: mythvirtualkeyboard.cpp:495
KeyDefinition::name
QString name
Definition: mythvirtualkeyboard.h:20
KeyEventDefinition::keyCode
int keyCode
Definition: mythvirtualkeyboard.h:28
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
MythUIType::GetArea
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
Definition: mythuitype.cpp:870
MythUIVirtualKeyboard::parseKey
void parseKey(const QDomElement &element)
Definition: mythvirtualkeyboard.cpp:227
MythUIVirtualKeyboard::updateKeys
void updateKeys(bool connectSignals=false)
Definition: mythvirtualkeyboard.cpp:282
mythvirtualkeyboard.h
MythUIVirtualKeyboard::Create
bool Create(void) override
Definition: mythvirtualkeyboard.cpp:93
MythUIVirtualKeyboard::m_preferredPos
PopupPosition m_preferredPos
Definition: mythvirtualkeyboard.h:76
mythfontproperties.h
KeyDefinition::up
QString up
Definition: mythvirtualkeyboard.h:23
MythUIVirtualKeyboard::m_newlineKey
KeyEventDefinition m_newlineKey
Definition: mythvirtualkeyboard.h:97
mythlogging.h
MythUIVirtualKeyboard::m_downKey
KeyEventDefinition m_downKey
Definition: mythvirtualkeyboard.h:94
VK_POSCENTERDIALOG
@ VK_POSCENTERDIALOG
Definition: mythvirtualkeyboard.h:15
KeyDefinition::type
QString type
Definition: mythvirtualkeyboard.h:21
MythUIVirtualKeyboard::MythUIVirtualKeyboard
MythUIVirtualKeyboard(MythScreenStack *parentStack, MythUITextEdit *m_parentEdit)
Definition: mythvirtualkeyboard.cpp:76
MythUIType::SetPosition
void SetPosition(int x, int y)
Convenience method, calls SetPosition(const MythPoint&) Override that instead to change functionality...
Definition: mythuitype.cpp:518
MythScreenType::SetFocusWidget
bool SetFocusWidget(MythUIType *widget=nullptr)
Definition: mythscreentype.cpp:117
MythUIVirtualKeyboard::getKeyText
QString getKeyText(const KeyDefinition &key) const
Definition: mythvirtualkeyboard.cpp:615
MythUIVirtualKeyboard::altClicked
void altClicked(void)
Definition: mythvirtualkeyboard.cpp:519
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
MythUIButton
A single button widget.
Definition: mythuibutton.h:22
MythPoint::setY
void setY(const QString &sY)
Definition: mythrect.cpp:541
MythUIVirtualKeyboard::m_altButton
MythUIButton * m_altButton
Definition: mythvirtualkeyboard.h:81
KeyDefinition
Definition: mythvirtualkeyboard.h:19
MythUIVirtualKeyboard::keyPressed
void keyPressed(QString key)
MythUIVirtualKeyboard::m_alt
bool m_alt
Definition: mythvirtualkeyboard.h:87
MythUIVirtualKeyboard::m_shiftLButton
MythUIButton * m_shiftLButton
Definition: mythvirtualkeyboard.h:83
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
MythUIVirtualKeyboard::delClicked
void delClicked(void)
Definition: mythvirtualkeyboard.cpp:483
MythUIVirtualKeyboard::m_parentEdit
MythUITextEdit * m_parentEdit
Definition: mythvirtualkeyboard.h:75
MythUIVirtualKeyboard::moveleftClicked
void moveleftClicked(void)
Definition: mythvirtualkeyboard.cpp:544
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:66
MythUIVirtualKeyboard::m_shiftRButton
MythUIButton * m_shiftRButton
Definition: mythvirtualkeyboard.h:84
mythuihelper.h
MythUITextEdit::GetKeyboardPosition
PopupPosition GetKeyboardPosition(void)
Definition: mythuitextedit.h:57
MythRect::moveTopLeft
void moveTopLeft(const QPoint &point)
Definition: mythrect.cpp:296
MythUIVirtualKeyboard::m_rightKey
KeyEventDefinition m_rightKey
Definition: mythvirtualkeyboard.h:96
MythUIVirtualKeyboard::m_compButton
MythUIButton * m_compButton
Definition: mythvirtualkeyboard.h:82
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:414
MythUIVirtualKeyboard::m_composeStr
QString m_composeStr
Definition: mythvirtualkeyboard.h:91
MythUIVirtualKeyboard::moverightClicked
void moverightClicked(void)
Definition: mythvirtualkeyboard.cpp:563
mythcorecontext.h
mythuitextedit.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
MythCoreContext::GetLanguageAndVariant
QString GetLanguageAndVariant(void)
Returns the user-set language and variant.
Definition: mythcorecontext.cpp:1791
MythUIVirtualKeyboard::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: mythvirtualkeyboard.cpp:349
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:107
build_compdb.action
action
Definition: build_compdb.py:9
mythuibutton.h
MythUIVirtualKeyboard::m_composing
bool m_composing
Definition: mythvirtualkeyboard.h:90
MythUIVirtualKeyboard::m_shift
bool m_shift
Definition: mythvirtualkeyboard.h:86
MythPoint::setX
void setX(const QString &sX)
Definition: mythrect.cpp:531
MythUIVirtualKeyboard::m_lockButton
MythUIButton * m_lockButton
Definition: mythvirtualkeyboard.h:80
KeyDefinition::left
QString left
Definition: mythvirtualkeyboard.h:23
GetMythUI
MythUIHelper * GetMythUI()
Definition: mythuihelper.cpp:81
MythUITextEdit::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythuitextedit.cpp:423
mythmainwindow.h
MythUIVirtualKeyboard::m_keyMap
QMap< QString, KeyDefinition > m_keyMap
Definition: mythvirtualkeyboard.h:78
VK_POSABOVEEDIT
@ VK_POSABOVEEDIT
Definition: mythvirtualkeyboard.h:11
MythUIVirtualKeyboard::decodeChar
static QString decodeChar(QString c)
Definition: mythvirtualkeyboard.cpp:582
KeyEventDefinition::modifiers
Qt::KeyboardModifiers modifiers
Definition: mythvirtualkeyboard.h:29
MythMainWindow::GetKey
static QString GetKey(const QString &context, const QString &action)
Definition: mythmainwindow.cpp:1303
MythUIHelper::GetScreenSettings
QRect GetScreenSettings(void)
Definition: mythuihelper.cpp:803
MythUIVirtualKeyboard::m_lock
bool m_lock
Definition: mythvirtualkeyboard.h:88
MythPoint
Wrapper around QPoint allowing us to handle percentage and other relative values for positioning in m...
Definition: mythrect.h:89