summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-18 17:12:26 +0000
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-19 09:56:37 +0000
commit2473ab1cf217a989849190cbfa47fe312698adb9 (patch)
tree7b3b278c27b1f7535895db56660395ca83309556 /demos
parent20679e140afc2cea8ff16043d40a0da1145e4165 (diff)
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
Diffstat (limited to 'demos')
-rw-r--r--demos/qmediaplayer/mediaplayer.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp
index a396c70535..4e0da3f8cc 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);
}