From 3d87337d184edc6ec43484685a7b4ec05a01df78 Mon Sep 17 00:00:00 2001 From: Iain Date: Mon, 7 Jun 2010 10:12:23 +0100 Subject: New keys for media-related keys, common mobile keys Various new keys: - introduce a proper key for pausing media - the existing Key_Pause was mapped to the Pause/Break key on a QWERTY keyboard. (In order not to break BC on applications that have been using the directfb keyboard map, the key mapping for DIKS_PLAYPAUSE *was not* updated). - introduce explicit keys to handle the case where play/pause is a single (toggling state) key rather than two discrete keys; same thing for a toggling version of call/hangup. - add new keys for voice dial and last number redial NOTE: Due to renumbering Key_Camera and Key_CameraFocus in order to make space in the more mobile-specific key range, this change introduces a binary compatibility break between this change and anything built before (ie. with Qt 4.7 beta 1 or earlier) (But not Qt 4.6, since the camera and camera focus keys were not in 4.6) Reviewed-by: axis Reviewed-by: Shane Kearns --- src/corelib/global/qnamespace.h | 14 ++++++++++---- src/corelib/global/qnamespace.qdoc | 19 ++++++++++++------- src/gui/kernel/qkeysequence.cpp | 30 +++++++++++++++++++++++------- 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 607ab52..a9c56f6 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -948,6 +948,8 @@ public: #endif Key_MediaNext = 0x01000083, Key_MediaRecord = 0x01000084, + Key_MediaPause = 0x1000085, + Key_MediaTogglePlayPause = 0x1000086, Key_HomePage = 0x01000090, Key_Favorites = 0x01000091, Key_Search = 0x01000092, @@ -1090,11 +1092,15 @@ public: Key_Context2 = 0x01100001, Key_Context3 = 0x01100002, Key_Context4 = 0x01100003, - Key_Call = 0x01100004, - Key_Hangup = 0x01100005, + Key_Call = 0x01100004, // set absolute state to in a call (do not toggle state) + Key_Hangup = 0x01100005, // set absolute state to hang up (do not toggle state) Key_Flip = 0x01100006, - Key_Camera = 0x01100007, - Key_CameraFocus = 0x01100008, + Key_ToggleCallHangup = 0x01100007, // a toggle key for answering, or hanging up, based on current call state + Key_VoiceDial = 0x01100008, + Key_LastNumberRedial = 0x01100009, + + Key_Camera = 0x01100020, + Key_CameraFocus = 0x01100021, Key_unknown = 0x01ffffff }; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f71ba9d..7eae3a5 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1317,7 +1317,7 @@ \value Key_Enter Typically located on the keypad. \value Key_Insert \value Key_Delete - \value Key_Pause + \value Key_Pause The Pause/Break key (\note Not anything to do with pausing media) \value Key_Print \value Key_SysReq \value Key_Clear @@ -1615,12 +1615,14 @@ \value Key_BassDown \value Key_TrebleUp \value Key_TrebleDown - \value Key_MediaPlay - \value Key_MediaStop + \value Key_MediaPlay A key setting the state of the media player to play + \value Key_MediaStop A key setting the state of the media player to stop \value Key_MediaPrevious \omitvalue Key_MediaPrev \value Key_MediaNext \value Key_MediaRecord + \value Key_MediaPause A key setting the state of the media player to pause (\note not the pause/break key) + \value Key_MediaTogglePlayPause A key to toggle the play/pause state in the media player (rather than setting an absolute state) \value Key_HomePage \value Key_Favorites \value Key_Search @@ -1741,18 +1743,21 @@ \value Key_MediaLast \value Key_unknown - \value Key_Call - \value Key_Camera - \value Key_CameraFocus + \value Key_Call A key to answer or initiate a call (\see Key_ToggleCallHangup for a key to toggle current call state) + \value Key_Camera A key to activate the camera shutter + \value Key_CameraFocus A key to focus the camera \value Key_Context1 \value Key_Context2 \value Key_Context3 \value Key_Context4 \value Key_Flip - \value Key_Hangup + \value Key_Hangup A key to end an ongoing call (\see Key_ToggleCallHangup for a key to toggle current call state) \value Key_No \value Key_Select \value Key_Yes + \value Key_ToggleCallHangup A key to toggle the current call state (ie. either answer, or hangup) depending on current call state + \value Key_VoiceDial + \value Key_LastNumberRedial \value Key_Execute \value Key_Printer diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 931bc33..c2f275a 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -439,6 +439,10 @@ static const struct { { Qt::Key_MediaPrevious, QT_TRANSLATE_NOOP("QShortcut", "Media Previous") }, { Qt::Key_MediaNext, QT_TRANSLATE_NOOP("QShortcut", "Media Next") }, { Qt::Key_MediaRecord, QT_TRANSLATE_NOOP("QShortcut", "Media Record") }, + //: Media player pause button + { Qt::Key_MediaPause, QT_TRANSLATE_NOOP("QShortcut", "Media Pause") }, + //: Media player button to toggle between playing and paused + { Qt::Key_MediaTogglePlayPause, QT_TRANSLATE_NOOP("QShortcut", "Toggle Media Play/Pause") }, { Qt::Key_HomePage, QT_TRANSLATE_NOOP("QShortcut", "Home Page") }, { Qt::Key_Favorites, QT_TRANSLATE_NOOP("QShortcut", "Favorites") }, { Qt::Key_Search, QT_TRANSLATE_NOOP("QShortcut", "Search") }, @@ -575,13 +579,25 @@ static const struct { // -------------------------------------------------------------- // Device keys - { Qt::Key_Context1, QT_TRANSLATE_NOOP("QShortcut", "Context1") }, - { Qt::Key_Context2, QT_TRANSLATE_NOOP("QShortcut", "Context2") }, - { Qt::Key_Context3, QT_TRANSLATE_NOOP("QShortcut", "Context3") }, - { Qt::Key_Context4, QT_TRANSLATE_NOOP("QShortcut", "Context4") }, - { Qt::Key_Call, QT_TRANSLATE_NOOP("QShortcut", "Call") }, - { Qt::Key_Hangup, QT_TRANSLATE_NOOP("QShortcut", "Hangup") }, - { Qt::Key_Flip, QT_TRANSLATE_NOOP("QShortcut", "Flip") }, + { Qt::Key_Context1, QT_TRANSLATE_NOOP("QShortcut", "Context1") }, + { Qt::Key_Context2, QT_TRANSLATE_NOOP("QShortcut", "Context2") }, + { Qt::Key_Context3, QT_TRANSLATE_NOOP("QShortcut", "Context3") }, + { Qt::Key_Context4, QT_TRANSLATE_NOOP("QShortcut", "Context4") }, + //: Button to start a call (note: a separate button is used to end the call) + { Qt::Key_Call, QT_TRANSLATE_NOOP("QShortcut", "Call") }, + //: Button to end a call (note: a separate button is used to start the call) + { Qt::Key_Hangup, QT_TRANSLATE_NOOP("QShortcut", "Hangup") }, + //: Button that will hang up if we're in call, or make a call if we're not. + { Qt::Key_ToggleCallHangup, QT_TRANSLATE_NOOP("QShortcut", "Toggle Call/Hangup") }, + { Qt::Key_Flip, QT_TRANSLATE_NOOP("QShortcut", "Flip") }, + //: Button to trigger voice dialling + { Qt::Key_VoiceDial, QT_TRANSLATE_NOOP("QShortcut", "Voice Dial") }, + //: Button to redial the last number called + { Qt::Key_LastNumberRedial, QT_TRANSLATE_NOOP("QShortcut", "Last Number Redial") }, + //: Button to trigger the camera shutter (take a picture) + { Qt::Key_Camera, QT_TRANSLATE_NOOP("QShortcut", "Camera Shutter") }, + //: Button to focus the camera + { Qt::Key_CameraFocus, QT_TRANSLATE_NOOP("QShortcut", "Camera Focus") }, // -------------------------------------------------------------- // Japanese keyboard support -- cgit v0.12