diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-11-18 17:12:26 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2009-11-19 09:56:37 (GMT) |
commit | 2473ab1cf217a989849190cbfa47fe312698adb9 (patch) | |
tree | 7b3b278c27b1f7535895db56660395ca83309556 | |
parent | 20679e140afc2cea8ff16043d40a0da1145e4165 (diff) | |
download | Qt-2473ab1cf217a989849190cbfa47fe312698adb9.zip Qt-2473ab1cf217a989849190cbfa47fe312698adb9.tar.gz Qt-2473ab1cf217a989849190cbfa47fe312698adb9.tar.bz2 |
Added additional keyboard shortcuts to MediaPlayer
These shortcuts are used for pausing video playback while in
full-screen mode, and for exiting full-screen mode.
They are for non-QWERTY mobile devices, which lack keys mapping to
the previously existing shortcut keycodes.
Reviewed-by: Frans Englich
-rw-r--r-- | demos/qmediaplayer/mediaplayer.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp index a396c70..4e0da3f 100644 --- a/demos/qmediaplayer/mediaplayer.cpp +++ b/demos/qmediaplayer/mediaplayer.cpp @@ -73,14 +73,23 @@ void MediaVideoWidget::mouseDoubleClickEvent(QMouseEvent *e) void MediaVideoWidget::keyPressEvent(QKeyEvent *e) { - if (e->key() == Qt::Key_Space && !e->modifiers()) { - m_player->playPause(); - e->accept(); - return; - } else if (e->key() == Qt::Key_Escape && !e->modifiers()) { - setFullScreen(false); - e->accept(); - return; + if(!e->modifiers()) { + // On non-QWERTY Symbian key-based devices, there is no space key. + // The zero key typically is marked with a space character. + if (e->key() == Qt::Key_Space || e->key() == Qt::Key_0) { + m_player->playPause(); + e->accept(); + return; + } + + // On Symbian devices, there is no key which maps to Qt::Key_Escape + // On devices which lack a backspace key (i.e. non-QWERTY devices), + // the 'C' key maps to Qt::Key_Backspace + else if (e->key() == Qt::Key_Escape || e->key() == Qt::Key_Backspace) { + setFullScreen(false); + e->accept(); + return; + } } Phonon::VideoWidget::keyPressEvent(e); } |