diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp
index e9976cf7f40..fd786dd9730 100644
|
a
|
b
|
bool MythMainWindow::keyLongPressFilter(QEvent **e,
|
| 2176 | 2176 | if (!ke) |
| 2177 | 2177 | return false; |
| 2178 | 2178 | int keycode = ke->key(); |
| | 2179 | // Ignore unknown key codes |
| | 2180 | if (keycode == 0) |
| | 2181 | return false; |
| 2179 | 2182 | |
| 2180 | 2183 | switch ((*e)->type()) |
| 2181 | 2184 | { |
| 2182 | 2185 | case QEvent::KeyPress: |
| 2183 | 2186 | { |
| 2184 | 2187 | // Check if we are in the middle of a long press |
| 2185 | | if (keycode != 0 && keycode == d->m_longPressKeyCode) |
| | 2188 | if (keycode == d->m_longPressKeyCode) |
| 2186 | 2189 | { |
| 2187 | 2190 | if (ke->timestamp() - d->m_longPressTime < LONGPRESS_INTERVAL |
| 2188 | 2191 | || d->m_longPressTime == 0) |
| … |
… |
bool MythMainWindow::keyLongPressFilter(QEvent **e,
|
| 2203 | 2206 | return false; |
| 2204 | 2207 | } |
| 2205 | 2208 | } |
| | 2209 | // If we got a keycode different from the long press keycode it |
| | 2210 | // may have been injected by a jump point. Ignore it. |
| | 2211 | if (d->m_longPressKeyCode != 0) |
| | 2212 | return false; |
| | 2213 | |
| | 2214 | // Process start of possible new long press. |
| 2206 | 2215 | d->m_longPressKeyCode = 0; |
| 2207 | 2216 | QStringList actions; |
| 2208 | 2217 | bool handled = TranslateKeyPress("Long Press", |
| … |
… |
bool MythMainWindow::keyLongPressFilter(QEvent **e,
|
| 2226 | 2235 | } |
| 2227 | 2236 | case QEvent::KeyRelease: |
| 2228 | 2237 | { |
| 2229 | | if (keycode != 0 && keycode == d->m_longPressKeyCode) |
| | 2238 | if (keycode == d->m_longPressKeyCode) |
| 2230 | 2239 | { |
| 2231 | 2240 | if (ke->isAutoRepeat()) |
| 2232 | 2241 | return true; |
| … |
… |
bool MythMainWindow::eventFilter(QObject *, QEvent *e)
|
| 2271 | 2280 | |
| 2272 | 2281 | QScopedPointer<QEvent> sNewEvent(NULL); |
| 2273 | 2282 | if (keyLongPressFilter(&e, sNewEvent)) |
| 2274 | | return false; |
| | 2283 | return true; |
| 2275 | 2284 | |
| 2276 | 2285 | switch (e->type()) |
| 2277 | 2286 | { |