1 | diff --git a/mythtv/programs/mythfrontend/services/frontend.cpp b/mythtv/programs/mythfrontend/services/frontend.cpp |
---|
2 | index 884cf3a..19ce0b7 100644 |
---|
3 | --- a/mythtv/programs/mythfrontend/services/frontend.cpp |
---|
4 | +++ b/mythtv/programs/mythfrontend/services/frontend.cpp |
---|
5 | @@ -87,6 +87,74 @@ bool Frontend::SendNotification(bool Error, |
---|
6 | bool Frontend::SendAction(const QString &Action, const QString &Value, |
---|
7 | uint Width, uint Height) |
---|
8 | { |
---|
9 | + QMap <QString, int> keyMap; |
---|
10 | + |
---|
11 | + keyMap["up"] = Qt::Key_Up; |
---|
12 | + keyMap["down"] = Qt::Key_Down; |
---|
13 | + keyMap["left"] = Qt::Key_Left; |
---|
14 | + keyMap["right"] = Qt::Key_Right; |
---|
15 | + keyMap["home"] = Qt::Key_Home; |
---|
16 | + keyMap["end"] = Qt::Key_End; |
---|
17 | + keyMap["enter"] = Qt::Key_Enter; |
---|
18 | + keyMap["return"] = Qt::Key_Return; |
---|
19 | + keyMap["pageup"] = Qt::Key_PageUp; |
---|
20 | + keyMap["pagedown"] = Qt::Key_PageDown; |
---|
21 | + keyMap["escape"] = Qt::Key_Escape; |
---|
22 | + keyMap["tab"] = Qt::Key_Tab; |
---|
23 | + keyMap["backtab"] = Qt::Key_Backtab; |
---|
24 | + keyMap["space"] = Qt::Key_Space; |
---|
25 | + keyMap["backspace"] = Qt::Key_Backspace; |
---|
26 | + keyMap["insert"] = Qt::Key_Insert; |
---|
27 | + keyMap["delete"] = Qt::Key_Delete; |
---|
28 | + keyMap["plus"] = Qt::Key_Plus; |
---|
29 | + keyMap["comma"] = Qt::Key_Comma; |
---|
30 | + keyMap["minus"] = Qt::Key_Minus; |
---|
31 | + keyMap["underscore"] = Qt::Key_Underscore; |
---|
32 | + keyMap["period"] = Qt::Key_Period; |
---|
33 | + keyMap["numbersign"] = Qt::Key_NumberSign; |
---|
34 | + keyMap["poundsign"] = Qt::Key_NumberSign; |
---|
35 | + keyMap["hash"] = Qt::Key_NumberSign; |
---|
36 | + keyMap["bracketleft"] = Qt::Key_BracketLeft; |
---|
37 | + keyMap["bracketright"] = Qt::Key_BracketRight; |
---|
38 | + keyMap["backslash"] = Qt::Key_Backslash; |
---|
39 | + keyMap["dollar"] = Qt::Key_Dollar; |
---|
40 | + keyMap["percent"] = Qt::Key_Percent; |
---|
41 | + keyMap["ampersand"] = Qt::Key_Ampersand; |
---|
42 | + keyMap["parenleft"] = Qt::Key_ParenLeft; |
---|
43 | + keyMap["parenright"] = Qt::Key_ParenRight; |
---|
44 | + keyMap["asterisk"] = Qt::Key_Asterisk; |
---|
45 | + keyMap["question"] = Qt::Key_Question; |
---|
46 | + keyMap["slash"] = Qt::Key_Slash; |
---|
47 | + keyMap["colon"] = Qt::Key_Colon; |
---|
48 | + keyMap["semicolon"] = Qt::Key_Semicolon; |
---|
49 | + keyMap["less"] = Qt::Key_Less; |
---|
50 | + keyMap["equal"] = Qt::Key_Equal; |
---|
51 | + keyMap["greater"] = Qt::Key_Greater; |
---|
52 | + keyMap["f1"] = Qt::Key_F1; |
---|
53 | + keyMap["f2"] = Qt::Key_F2; |
---|
54 | + keyMap["f3"] = Qt::Key_F3; |
---|
55 | + keyMap["f4"] = Qt::Key_F4; |
---|
56 | + keyMap["f5"] = Qt::Key_F5; |
---|
57 | + keyMap["f6"] = Qt::Key_F6; |
---|
58 | + keyMap["f7"] = Qt::Key_F7; |
---|
59 | + keyMap["f8"] = Qt::Key_F8; |
---|
60 | + keyMap["f9"] = Qt::Key_F9; |
---|
61 | + keyMap["f10"] = Qt::Key_F10; |
---|
62 | + keyMap["f11"] = Qt::Key_F11; |
---|
63 | + keyMap["f12"] = Qt::Key_F12; |
---|
64 | + keyMap["f13"] = Qt::Key_F13; |
---|
65 | + keyMap["f14"] = Qt::Key_F14; |
---|
66 | + keyMap["f15"] = Qt::Key_F15; |
---|
67 | + keyMap["f16"] = Qt::Key_F16; |
---|
68 | + keyMap["f17"] = Qt::Key_F17; |
---|
69 | + keyMap["f18"] = Qt::Key_F18; |
---|
70 | + keyMap["f19"] = Qt::Key_F19; |
---|
71 | + keyMap["f20"] = Qt::Key_F20; |
---|
72 | + keyMap["f21"] = Qt::Key_F21; |
---|
73 | + keyMap["f22"] = Qt::Key_F22; |
---|
74 | + keyMap["f23"] = Qt::Key_F23; |
---|
75 | + keyMap["f24"] = Qt::Key_F24; |
---|
76 | + |
---|
77 | if (!IsValidAction(Action)) |
---|
78 | return false; |
---|
79 | |
---|
80 | @@ -120,8 +188,11 @@ bool Frontend::SendAction(const QString &Action, const QString &Value, |
---|
81 | return true; |
---|
82 | } |
---|
83 | |
---|
84 | - QKeyEvent* ke = new QKeyEvent(QEvent::KeyPress, 0, Qt::NoModifier, Action); |
---|
85 | - qApp->postEvent(GetMythMainWindow(), (QEvent*)ke); |
---|
86 | + if (Action.size() == 1 || keyMap.contains(Action.toLower())) |
---|
87 | + SendKey(Action); |
---|
88 | + else |
---|
89 | + GetMythMainWindow()->JumpTo(Action); |
---|
90 | + |
---|
91 | return true; |
---|
92 | } |
---|
93 | |
---|