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