Index: libs/libmythui/mythuibuttonlist.h =================================================================== --- libs/libmythui/mythuibuttonlist.h (revision 23010) +++ libs/libmythui/mythuibuttonlist.h (working copy) @@ -215,6 +215,7 @@ QVector m_ButtonList; QMap m_ButtonToItem; + QMap m_TriggerEvents; bool m_initialized; bool m_needsUpdate; Index: libs/libmythui/mythuibuttonlist.cpp =================================================================== --- libs/libmythui/mythuibuttonlist.cpp (revision 23010) +++ libs/libmythui/mythuibuttonlist.cpp (working copy) @@ -1,3 +1,5 @@ +#include +#include #include "mythuibuttonlist.h" @@ -828,8 +830,34 @@ QString action = actions[i]; handled = true; - if (action == "UP") + if (m_TriggerEvents.contains(action)) { + QString key = m_TriggerEvents[action]; + + QKeySequence a(key); + int keyCode = a[0]; + Qt::KeyboardModifiers modifiers = Qt::NoModifier; + + QStringList parts = key.split('+'); + + for (int j = 0; j < parts.count(); j++) + { + if (parts[j].toUpper() == "CTRL") + modifiers |= Qt::ControlModifier; + if (parts[j].toUpper() == "SHIFT") + modifiers |= Qt::ShiftModifier; + if (parts[j].toUpper() == "ALT") + modifiers |= Qt::AltModifier; + if (parts[j].toUpper() == "META") + modifiers |= Qt::MetaModifier; + }; + + QKeyEvent *event = new QKeyEvent(QEvent::KeyPress, keyCode, modifiers, key); + MythMainWindow *window = GetMythMainWindow(); + QApplication::postEvent(window, event); + } + else if (action == "UP") + { if ((m_layout == LayoutVertical) || (m_layout == LayoutGrid)) handled = MoveUp(MoveRow); else @@ -1033,6 +1061,17 @@ } else if (element.tagName() == "drawfrombottom") m_drawFromBottom = parseBool(element); + else if (element.tagName() == "triggerevent") + { + MythMainWindow *window = GetMythMainWindow(); + + QString context = element.attribute("context", ""); + QString action = element.attribute("action", ""); + QString keylist = window->GetKey(context, action); + QStringList keys = keylist.split(',', QString::SkipEmptyParts); + QString trigger = getFirstText(element); + m_TriggerEvents[trigger] = keys[0]; + } else return MythUIType::ParseElement(element);