Bug 1027007 Support multimedia keyboard's special key values "Close", "MailForward", "MailReply", "MailSend", "New", "Open", "Print" and "SpellCheck" on GTK and Qt r=smaug+karlt+romaxa
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 30 Dec 2014 10:47:55 +0900
changeset 249144 c644cc4c6b9b74e4dbe1eba49ba7cbba09251cfd
parent 249143 700aa7de43c744e8f4f73b9fc9caa70ad9563788
child 249145 bf9c0ad8d4bb6bb4d1e8d6697479b71085675d0c
push id698
push userjlund@mozilla.com
push dateMon, 23 Mar 2015 22:08:11 +0000
treeherdermozilla-release@b0c0ae7b02a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1027007
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1027007 Support multimedia keyboard's special key values "Close", "MailForward", "MailReply", "MailSend", "New", "Open", "Print" and "SpellCheck" on GTK and Qt r=smaug+karlt+romaxa
dom/events/KeyNameList.h
widget/NativeKeyToDOMKeyName.h
widget/qt/nsQtKeyUtils.cpp
--- a/dom/events/KeyNameList.h
+++ b/dom/events/KeyNameList.h
@@ -201,30 +201,30 @@ DEFINE_KEYNAME_WITH_SAME_NAME(F35)
 // DEFINE_KEYNAME_WITH_SAME_NAME(Soft1)
 // DEFINE_KEYNAME_WITH_SAME_NAME(Soft2)
 // DEFINE_KEYNAME_WITH_SAME_NAME(Soft3)
 // DEFINE_KEYNAME_WITH_SAME_NAME(Soft4)
 
 /******************************************************************************
  * Multimedia Keys
  *****************************************************************************/
-// DEFINE_KEYNAME_WITH_SAME_NAME(Close)
-// DEFINE_KEYNAME_WITH_SAME_NAME(MailForward)
-// DEFINE_KEYNAME_WITH_SAME_NAME(MailReply)
-// DEFINE_KEYNAME_WITH_SAME_NAME(MailSend)
+DEFINE_KEYNAME_WITH_SAME_NAME(Close)
+DEFINE_KEYNAME_WITH_SAME_NAME(MailForward)
+DEFINE_KEYNAME_WITH_SAME_NAME(MailReply)
+DEFINE_KEYNAME_WITH_SAME_NAME(MailSend)
 DEFINE_KEYNAME_WITH_SAME_NAME(MediaPlayPause)
 DEFINE_KEYNAME_WITH_SAME_NAME(MediaSelect)
 DEFINE_KEYNAME_WITH_SAME_NAME(MediaStop)
 DEFINE_KEYNAME_WITH_SAME_NAME(MediaTrackNext)
 DEFINE_KEYNAME_WITH_SAME_NAME(MediaTrackPrevious)
-// DEFINE_KEYNAME_WITH_SAME_NAME(New)
-// DEFINE_KEYNAME_WITH_SAME_NAME(Open)
-// DEFINE_KEYNAME_WITH_SAME_NAME(Print)
-// DEFINE_KEYNAME_WITH_SAME_NAME(Save)
-// DEFINE_KEYNAME_WITH_SAME_NAME(SpellCheck)
+DEFINE_KEYNAME_WITH_SAME_NAME(New)
+DEFINE_KEYNAME_WITH_SAME_NAME(Open)
+DEFINE_KEYNAME_WITH_SAME_NAME(Print)
+DEFINE_KEYNAME_WITH_SAME_NAME(Save)
+DEFINE_KEYNAME_WITH_SAME_NAME(SpellCheck)
 DEFINE_KEYNAME_WITH_SAME_NAME(VolumeDown)
 DEFINE_KEYNAME_WITH_SAME_NAME(VolumeUp)
 DEFINE_KEYNAME_WITH_SAME_NAME(VolumeMute)
 
 /******************************************************************************
  * Application Keys
  *****************************************************************************/
 DEFINE_KEYNAME_WITH_SAME_NAME(LaunchCalculator)
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -856,16 +856,34 @@ KEY_MAP_QT      (F34, Qt::Key_F34)
 
 // F35
 KEY_MAP_GTK     (F35, GDK_F35 /* same as GDK_R15 */)
 KEY_MAP_QT      (F35, Qt::Key_F35)
 
 /******************************************************************************
  * Multimedia Keys
  ******************************************************************************/
+// Close
+// NOTE: This is not a key to close disk tray, this is a key to close document
+//       or window.
+KEY_MAP_GTK     (Close, GDK_Close)
+KEY_MAP_QT      (Close, Qt::Key_Close)
+
+// MailForward
+KEY_MAP_GTK     (MailForward, GDK_MailForward)
+KEY_MAP_QT      (MailForward, Qt::Key_MailForward)
+
+// MailReply
+KEY_MAP_GTK     (MailReply, GDK_Reply)
+KEY_MAP_QT      (MailReply, Qt::Key_Reply)
+
+// MailSend
+KEY_MAP_GTK     (MailSend, GDK_Send)
+KEY_MAP_QT      (MailSend, Qt::Key_Send)
+
 // MediaPlayPause
 KEY_MAP_WIN     (MediaPlayPause, VK_MEDIA_PLAY_PAUSE)
 KEY_MAP_QT      (MediaPlayPause, Qt::Key_MediaTogglePlayPause)
 KEY_MAP_ANDROID (MediaPlayPause, AKEYCODE_MEDIA_PLAY_PAUSE)
 
 // MediaSelect
 KEY_MAP_WIN     (MediaSelect, VK_LAUNCH_MEDIA_SELECT)
 KEY_MAP_GTK     (MediaSelect, GDK_AudioMedia)
@@ -883,16 +901,33 @@ KEY_MAP_QT      (MediaTrackNext, Qt::Key
 KEY_MAP_ANDROID (MediaTrackNext, AKEYCODE_MEDIA_NEXT)
 
 // MediaTrackPrevious
 KEY_MAP_WIN     (MediaTrackPrevious, VK_MEDIA_PREV_TRACK)
 KEY_MAP_GTK     (MediaTrackPrevious, GDK_AudioPrev)
 KEY_MAP_QT      (MediaTrackPrevious, Qt::Key_MediaPrevious)
 KEY_MAP_ANDROID (MediaTrackPrevious, AKEYCODE_MEDIA_PREVIOUS)
 
+// New
+KEY_MAP_GTK     (New, GDK_New)
+
+// Open
+KEY_MAP_GTK     (Open, GDK_Open)
+
+// Print
+KEY_MAP_QT      (Print, Qt::Key_Printer)
+
+// Save
+KEY_MAP_GTK     (Save, GDK_Save)
+KEY_MAP_QT      (Save, Qt::Key_Save)
+
+// SpellCheck
+KEY_MAP_GTK     (SpellCheck, GDK_Spell)
+KEY_MAP_QT      (SpellCheck, Qt::Key_Spell)
+
 // VolumeDown
 KEY_MAP_WIN     (VolumeDown, VK_VOLUME_DOWN)
 KEY_MAP_COCOA   (VolumeDown, kVK_VolumeDown)
 KEY_MAP_GTK     (VolumeDown, GDK_AudioLowerVolume)
 KEY_MAP_QT      (VolumeDown, Qt::Key_VolumeDown)
 KEY_MAP_ANDROID (VolumeDown, AKEYCODE_VOLUME_DOWN)
 
 // VolumeUp
--- a/widget/qt/nsQtKeyUtils.cpp
+++ b/widget/qt/nsQtKeyUtils.cpp
@@ -397,49 +397,43 @@ QtKeyCodeToDOMKeyNameIndex(int aKeysym)
         case Qt::Key_Finance:
         case Qt::Key_Community:
         case Qt::Key_BackForward:
         case Qt::Key_ApplicationLeft:
         case Qt::Key_ApplicationRight:
         case Qt::Key_Book:
         case Qt::Key_ToDoList:
         case Qt::Key_ClearGrab:
-        case Qt::Key_Close:
         case Qt::Key_Display:
         case Qt::Key_DOS:
         case Qt::Key_Documents:
         case Qt::Key_Game:
         case Qt::Key_Go:
         case Qt::Key_iTouch:
         case Qt::Key_Market:
         case Qt::Key_Meeting:
         case Qt::Key_MenuKB:
         case Qt::Key_MenuPB:
         case Qt::Key_MySites:
         case Qt::Key_News:
         case Qt::Key_OfficeHome:
         case Qt::Key_Option:
         case Qt::Key_Phone:
-        case Qt::Key_Reply:
         case Qt::Key_RotateWindows:
         case Qt::Key_RotationPB:
         case Qt::Key_RotationKB:
-        case Qt::Key_Save:
-        case Qt::Key_Send:
-        case Qt::Key_Spell:
         case Qt::Key_SplitScreen:
         case Qt::Key_Support:
         case Qt::Key_TaskPane:
         case Qt::Key_Terminal:
         case Qt::Key_Tools:
         case Qt::Key_Travel:
         case Qt::Key_Xfer:
         case Qt::Key_Away:
         case Qt::Key_Messenger:
-        case Qt::Key_MailForward:
         case Qt::Key_Pictures:
         case Qt::Key_Battery:
         case Qt::Key_Bluetooth:
         case Qt::Key_WLAN:
         case Qt::Key_UWB:
         case Qt::Key_AudioRepeat:
         case Qt::Key_AudioCycleTrack:
         case Qt::Key_Time:
@@ -459,17 +453,16 @@ QtKeyCodeToDOMKeyNameIndex(int aKeysym)
         case Qt::Key_Flip:
         case Qt::Key_Hangup:
         case Qt::Key_No:
         case Qt::Key_Select:
         case Qt::Key_Yes:
         case Qt::Key_ToggleCallHangup:
         case Qt::Key_VoiceDial:
         case Qt::Key_LastNumberRedial:
-        case Qt::Key_Printer:
         default:
             return KEY_NAME_INDEX_Unidentified;
     }
 }
 
 CodeNameIndex
 ScanCodeToDOMCodeNameIndex(int32_t aScanCode)
 {