Fix XCB launch key mapping

They have been reported wrong since Qt 4, and not fixed for behavior
compatibility, fixing it for Qt 6.

[ChangeLog][X11] XF86LaunchXX keys have been remapped, so the Qt names
and X11 names match, instead of being 2 off.

Pick-to: 6.0
Fixes: QTBUG-25261
Change-Id: Ie3a8676439ae3e93a78218c9e7f4443565e84356
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2021-01-13 14:22:32 +01:00
parent 2cf2f99ab1
commit cfd935fe6c
3 changed files with 37 additions and 37 deletions

View File

@ -997,6 +997,7 @@ namespace Qt {
Key_Suspend = 0x0100010c,
Key_ContrastAdjust = 0x0100010d,
// We can remove these two for Qt 7:
Key_LaunchG = 0x0100010e,
Key_LaunchH = 0x0100010f,

View File

@ -1651,24 +1651,24 @@
\value Key_OpenUrl
\value Key_LaunchMail
\value Key_LaunchMedia
\value Key_Launch0 On X11 this key is mapped to "My Computer" (XF86XK_MyComputer) key for legacy reasons.
\value Key_Launch1 On X11 this key is mapped to "Calculator" (XF86XK_Calculator) key for legacy reasons.
\value Key_Launch2 On X11 this key is mapped to XF86XK_Launch0 key for legacy reasons.
\value Key_Launch3 On X11 this key is mapped to XF86XK_Launch1 key for legacy reasons.
\value Key_Launch4 On X11 this key is mapped to XF86XK_Launch2 key for legacy reasons.
\value Key_Launch5 On X11 this key is mapped to XF86XK_Launch3 key for legacy reasons.
\value Key_Launch6 On X11 this key is mapped to XF86XK_Launch4 key for legacy reasons.
\value Key_Launch7 On X11 this key is mapped to XF86XK_Launch5 key for legacy reasons.
\value Key_Launch8 On X11 this key is mapped to XF86XK_Launch6 key for legacy reasons.
\value Key_Launch9 On X11 this key is mapped to XF86XK_Launch7 key for legacy reasons.
\value Key_LaunchA On X11 this key is mapped to XF86XK_Launch8 key for legacy reasons.
\value Key_LaunchB On X11 this key is mapped to XF86XK_Launch9 key for legacy reasons.
\value Key_LaunchC On X11 this key is mapped to XF86XK_LaunchA key for legacy reasons.
\value Key_LaunchD On X11 this key is mapped to XF86XK_LaunchB key for legacy reasons.
\value Key_LaunchE On X11 this key is mapped to XF86XK_LaunchC key for legacy reasons.
\value Key_LaunchF On X11 this key is mapped to XF86XK_LaunchD key for legacy reasons.
\value Key_LaunchG On X11 this key is mapped to XF86XK_LaunchE key for legacy reasons.
\value Key_LaunchH On X11 this key is mapped to XF86XK_LaunchF key for legacy reasons.
\value Key_Launch0
\value Key_Launch1
\value Key_Launch2
\value Key_Launch3
\value Key_Launch4
\value Key_Launch5
\value Key_Launch6
\value Key_Launch7
\value Key_Launch8
\value Key_Launch9
\value Key_LaunchA
\value Key_LaunchB
\value Key_LaunchC
\value Key_LaunchD
\value Key_LaunchE
\value Key_LaunchF
\value Key_LaunchG
\value Key_LaunchH
\value Key_MonBrightnessUp
\value Key_MonBrightnessDown
\value Key_KeyboardLightOnOff
@ -1694,7 +1694,7 @@
\value Key_ApplicationRight
\value Key_Book
\value Key_CD
\value Key_Calculator On X11 this key is not mapped for legacy reasons. Use Qt::Key_Launch1 instead.
\value Key_Calculator
\value Key_ToDoList
\value Key_ClearGrab
\value Key_Close

View File

@ -297,8 +297,7 @@ static constexpr const auto KeyTbl = qMakeArray(
Xkb2Qt<XKB_KEY_XF86AudioRecord, Qt::Key_MediaRecord>,
Xkb2Qt<XKB_KEY_XF86AudioPause, Qt::Key_MediaPause>,
Xkb2Qt<XKB_KEY_XF86Mail, Qt::Key_LaunchMail>,
Xkb2Qt<XKB_KEY_XF86MyComputer, Qt::Key_Launch0>, // ### Qt 6: remap properly
Xkb2Qt<XKB_KEY_XF86Calculator, Qt::Key_Launch1>,
Xkb2Qt<XKB_KEY_XF86MyComputer, Qt::Key_LaunchMedia>,
Xkb2Qt<XKB_KEY_XF86Memo, Qt::Key_Memo>,
Xkb2Qt<XKB_KEY_XF86ToDoList, Qt::Key_ToDoList>,
Xkb2Qt<XKB_KEY_XF86Calendar, Qt::Key_Calendar>,
@ -406,22 +405,22 @@ static constexpr const auto KeyTbl = qMakeArray(
Xkb2Qt<XKB_KEY_XF86TouchpadOn, Qt::Key_TouchpadOn>,
Xkb2Qt<XKB_KEY_XF86TouchpadOff, Qt::Key_TouchpadOff>,
Xkb2Qt<XKB_KEY_XF86AudioMicMute, Qt::Key_MicMute>,
Xkb2Qt<XKB_KEY_XF86Launch0, Qt::Key_Launch2>, // ### Qt 6: remap properly
Xkb2Qt<XKB_KEY_XF86Launch1, Qt::Key_Launch3>,
Xkb2Qt<XKB_KEY_XF86Launch2, Qt::Key_Launch4>,
Xkb2Qt<XKB_KEY_XF86Launch3, Qt::Key_Launch5>,
Xkb2Qt<XKB_KEY_XF86Launch4, Qt::Key_Launch6>,
Xkb2Qt<XKB_KEY_XF86Launch5, Qt::Key_Launch7>,
Xkb2Qt<XKB_KEY_XF86Launch6, Qt::Key_Launch8>,
Xkb2Qt<XKB_KEY_XF86Launch7, Qt::Key_Launch9>,
Xkb2Qt<XKB_KEY_XF86Launch8, Qt::Key_LaunchA>,
Xkb2Qt<XKB_KEY_XF86Launch9, Qt::Key_LaunchB>,
Xkb2Qt<XKB_KEY_XF86LaunchA, Qt::Key_LaunchC>,
Xkb2Qt<XKB_KEY_XF86LaunchB, Qt::Key_LaunchD>,
Xkb2Qt<XKB_KEY_XF86LaunchC, Qt::Key_LaunchE>,
Xkb2Qt<XKB_KEY_XF86LaunchD, Qt::Key_LaunchF>,
Xkb2Qt<XKB_KEY_XF86LaunchE, Qt::Key_LaunchG>,
Xkb2Qt<XKB_KEY_XF86LaunchF, Qt::Key_LaunchH>
Xkb2Qt<XKB_KEY_XF86Launch0, Qt::Key_Launch0>,
Xkb2Qt<XKB_KEY_XF86Launch1, Qt::Key_Launch1>,
Xkb2Qt<XKB_KEY_XF86Launch2, Qt::Key_Launch2>,
Xkb2Qt<XKB_KEY_XF86Launch3, Qt::Key_Launch3>,
Xkb2Qt<XKB_KEY_XF86Launch4, Qt::Key_Launch4>,
Xkb2Qt<XKB_KEY_XF86Launch5, Qt::Key_Launch5>,
Xkb2Qt<XKB_KEY_XF86Launch6, Qt::Key_Launch6>,
Xkb2Qt<XKB_KEY_XF86Launch7, Qt::Key_Launch7>,
Xkb2Qt<XKB_KEY_XF86Launch8, Qt::Key_Launch8>,
Xkb2Qt<XKB_KEY_XF86Launch9, Qt::Key_Launch9>,
Xkb2Qt<XKB_KEY_XF86LaunchA, Qt::Key_LaunchA>,
Xkb2Qt<XKB_KEY_XF86LaunchB, Qt::Key_LaunchB>,
Xkb2Qt<XKB_KEY_XF86LaunchC, Qt::Key_LaunchC>,
Xkb2Qt<XKB_KEY_XF86LaunchD, Qt::Key_LaunchD>,
Xkb2Qt<XKB_KEY_XF86LaunchE, Qt::Key_LaunchE>,
Xkb2Qt<XKB_KEY_XF86LaunchF, Qt::Key_LaunchF>
>::Data{}
);