27 LOG(VB_GENERAL, LOG_ERR,
"Theme is missing critical elements.");
31 QString label = QString(
"%1\n\n%2").arg(tr(
"Press A Key"),
32 tr(
"Waiting for key press"));
63 int keycode =
event->key();
66 if ((keycode == Qt::Key_Shift ) || (keycode == Qt::Key_Control) ||
67 (keycode == Qt::Key_Meta ) || (keycode == Qt::Key_Alt ) ||
68 (keycode == Qt::Key_Super_L ) || (keycode == Qt::Key_Super_R) ||
69 (keycode == Qt::Key_Hyper_L ) || (keycode == Qt::Key_Hyper_R) ||
70 (keycode == Qt::Key_AltGr ))
76 QString key_name = QKeySequence(keycode).toString();
77 if (!key_name.isEmpty())
82 if (((event->modifiers() & Qt::ShiftModifier) != 0U)
84 && keycode != Qt::Key_Backtab)
85 modifiers +=
"Shift+";
86 if ((event->modifiers() & Qt::ControlModifier) != 0U)
88 if ((event->modifiers() & Qt::AltModifier) != 0U)
90 if ((event->modifiers() & Qt::MetaModifier) != 0U)
93 key_name = modifiers + key_name;
96 if (key_name.isEmpty())
99 LOG(VB_GENERAL, LOG_ERR, QString(
"Pressed key not recognized: '%1' (keycode %2)").arg(event->text()).arg(event->nativeScanCode()) );
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
bool SetFocusWidget(MythUIType *widget=nullptr)
All purpose text widget, displays a text string.
virtual void SetText(const QString &text)
void SetEnabled(bool enable)
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)