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 = GetMythMainWindow()->GetScreenRect().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);
306  }
307  else if (key.type == "char")
309  else if (key.type == "done")
311  else if (key.type == "del")
313  else if (key.type == "lock")
314  {
315  m_lockButton = button;
316  m_lockButton->SetLockable(true);
318  }
319  else if (key.type == "alt")
320  {
321  m_altButton = button;
322  m_altButton->SetLockable(true);
324  }
325  else if (key.type == "comp")
326  {
327  m_compButton = button;
328  m_compButton->SetLockable(true);
330  }
331  else if (key.type == "moveleft")
333  else if (key.type == "moveright")
335  else if (key.type == "back")
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.key(),
538  m_newlineKey.keyboardModifiers(), "");
539  m_parentEdit->keyPressEvent(event);
540  }
541  else
542  Close();
543 }
544 
546 {
547  if (m_parentEdit)
548  {
549  if (m_shift)
550  {
551  emit keyPressed("{MOVEUP}");
552  auto *event = new QKeyEvent(QEvent::KeyPress, m_upKey.key(),
553  m_upKey.keyboardModifiers(), "");
554  m_parentEdit->keyPressEvent(event);
555  }
556  else
557  {
558  emit keyPressed("{MOVELEFT}");
559  auto *event = new QKeyEvent(QEvent::KeyPress, m_leftKey.key(),
560  m_leftKey.keyboardModifiers(), "");
561  m_parentEdit->keyPressEvent(event);
562  }
563  }
564 }
565 
567 {
568  if (m_parentEdit)
569  {
570  if (m_shift)
571  {
572  emit keyPressed("{MOVEDOWN}");
573  auto *event = new QKeyEvent(QEvent::KeyPress, m_downKey.key(),
574  m_downKey.keyboardModifiers(), "");
575  m_parentEdit->keyPressEvent(event);
576  }
577  else
578  {
579  emit keyPressed("{MOVERIGHT}");
580  auto *event = new QKeyEvent(QEvent::KeyPress, m_rightKey.key(),
581  m_rightKey.keyboardModifiers(), "");
582  m_parentEdit->keyPressEvent(event);
583  }
584  }
585 }
586 
588 {
589  QString res;
590 
591  while (c.length() > 0)
592  {
593  if (c.startsWith("0x"))
594  {
595  QString sCode = c.left(6);
596  bool bOK = false;
597  short nCode = sCode.toShort(&bOK, 16);
598 
599  c = c.mid(6);
600 
601  if (bOK)
602  {
603  QChar uc(nCode);
604  res += QString(uc);
605  }
606  else
607  LOG(VB_GENERAL, LOG_ERR, QString("bad char code (%1)")
608  .arg(sCode));
609  }
610  else
611  {
612  res += c.at(0);
613  c = c.mid(1);
614  }
615  }
616 
617  return res;
618 }
619 
621 {
622 
623  if (m_shift)
624  {
625  if (m_alt)
626  return key.altshift;
627  return key.shift;
628  }
629 
630  if (m_alt)
631  return key.alt;
632 
633  return key.normal;
634 }
635 
637 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
638  KeyEventDefinition *keyDef,
639 #else
640  QKeyCombination *keyDef,
641 #endif
642  const QString &action)
643 {
644  QString keylist = MythMainWindow::GetKey("Global", action);
645 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
646  QStringList keys = keylist.split(',', QString::SkipEmptyParts);
647 #else
648  QStringList keys = keylist.split(',', Qt::SkipEmptyParts);
649 #endif
650  if (keys.empty())
651  return;
652 
653  QKeySequence a(keys[0]);
654  if (a.isEmpty())
655  {
656  LOG(VB_GENERAL, LOG_ERR,
657  QString("loadEventKeyDefinitions bad key (%1)").arg(keys[0]));
658  return;
659  }
660 
661 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
662  keyDef->keyCode = a[0];
663 
664  Qt::KeyboardModifiers modifiers = Qt::NoModifier;
665  QStringList parts = keys[0].split('+');
666  for (int j = 0; j < parts.count(); j++)
667  {
668  if (parts[j].toUpper() == "CTRL")
669  modifiers |= Qt::ControlModifier;
670  if (parts[j].toUpper() == "SHIFT")
671  modifiers |= Qt::ShiftModifier;
672  if (parts[j].toUpper() == "ALT")
673  modifiers |= Qt::AltModifier;
674  if (parts[j].toUpper() == "META")
675  modifiers |= Qt::MetaModifier;
676  }
677 
678  keyDef->modifiers = modifiers;
679 #else
680  *keyDef = a[0];
681 #endif
682 }
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:25
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
MythUIVirtualKeyboard::loadKeyDefinitions
void loadKeyDefinitions(const QString &lang)
Definition: mythvirtualkeyboard.cpp:174
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:385
MythUIVirtualKeyboard::loadEventKeyDefinitions
static void loadEventKeyDefinitions(QKeyCombination *keyDef, const QString &action)
Definition: mythvirtualkeyboard.cpp:636
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:131
MythUIVirtualKeyboard::lockClicked
void lockClicked(void)
Definition: mythvirtualkeyboard.cpp:506
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:532
MythUIVirtualKeyboard::compClicked
void compClicked(void)
Definition: mythvirtualkeyboard.cpp:526
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:32
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:44
MythUIType::GetAllChildren
QList< MythUIType * > * GetAllChildren(void)
Return a list of all child widgets.
Definition: mythuitype.cpp:195
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:495
KeyDefinition::name
QString name
Definition: mythvirtualkeyboard.h:20
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::m_downKey
QKeyCombination m_downKey
Definition: mythvirtualkeyboard.h:113
MythMainWindow::GetKey
static QString GetKey(const QString &Context, const QString &Action)
Definition: mythmainwindow.cpp:1321
MythUIVirtualKeyboard::updateKeys
void updateKeys(bool connectSignals=false)
Definition: mythvirtualkeyboard.cpp:282
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:93
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:1116
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:620
MythUIVirtualKeyboard::altClicked
void altClicked(void)
Definition: mythvirtualkeyboard.cpp:519
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:205
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
MythPoint::setY
void setY(const QString &sY)
Definition: mythrect.cpp:541
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:60
MythUIVirtualKeyboard::delClicked
void delClicked(void)
Definition: mythvirtualkeyboard.cpp:483
MythUIVirtualKeyboard::m_parentEdit
MythUITextEdit * m_parentEdit
Definition: mythvirtualkeyboard.h:87
MythUIVirtualKeyboard::moveleftClicked
void moveleftClicked(void)
Definition: mythvirtualkeyboard.cpp:545
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:84
MythUIVirtualKeyboard::m_shiftRButton
MythUIButton * m_shiftRButton
Definition: mythvirtualkeyboard.h:96
mythuihelper.h
MythUITextEdit::GetKeyboardPosition
PopupPosition GetKeyboardPosition(void)
Definition: mythuitextedit.h:57
MythUIVirtualKeyboard::m_compButton
MythUIButton * m_compButton
Definition: mythvirtualkeyboard.h:94
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:397
MythUIVirtualKeyboard::m_composeStr
QString m_composeStr
Definition: mythvirtualkeyboard.h:103
MythUIVirtualKeyboard::moverightClicked
void moverightClicked(void)
Definition: mythvirtualkeyboard.cpp:566
mythcorecontext.h
mythuitextedit.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
MythUIScreenBounds::GetScreenRect
QRect GetScreenRect()
Definition: mythuiscreenbounds.cpp:211
MythCoreContext::GetLanguageAndVariant
QString GetLanguageAndVariant(void)
Returns the user-set language and variant.
Definition: mythcorecontext.cpp:1797
MythUIVirtualKeyboard::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: mythvirtualkeyboard.cpp:349
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
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:531
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:422
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:587
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