summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoman Savochenko <rom_as@oscada.org>2017-07-30 10:49:48 +0200
committerSlávek Banko <slavek.banko@axis.cz>2017-07-30 10:49:58 +0200
commit7b580ac8d083d50d7d572740569b1488d6f533a4 (patch)
treea572fbeba6188f6ff2b0b7c8feabb77b2561b182 /src
parent488cf3ec8eff16640bc7c5e1391f3f2e385ee4f6 (diff)
downloadqt3-7b580ac8d083d50d7d572740569b1488d6f533a4.tar.gz
qt3-7b580ac8d083d50d7d572740569b1488d6f533a4.zip
Add brightness keys support
The code partially taken from Qt4 This relates to bug 2775 Signed-off-by: Roman Savochenko <rom_as@oscada.org> (cherry picked from commit 02405c8411cbdf42fa8f73ce93598eb6f5cec0fe)
Diffstat (limited to 'src')
-rw-r--r--src/kernel/qapplication_x11.cpp10
-rw-r--r--src/kernel/qevent.cpp5
-rw-r--r--src/kernel/qkeysequence.cpp5
-rw-r--r--src/kernel/qnamespace.h5
4 files changed, 25 insertions, 0 deletions
diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp
index eba573b..c93c60f 100644
--- a/src/kernel/qapplication_x11.cpp
+++ b/src/kernel/qapplication_x11.cpp
@@ -4821,6 +4821,11 @@ bool QETWidget::translatePropertyEvent(const XEvent *event)
#define XF86XK_LaunchD 0x1008FF4D
#define XF86XK_LaunchE 0x1008FF4E
#define XF86XK_LaunchF 0x1008FF4F
+#define XF86XK_MonBrightnessUp 0x1008FF02 /* Monitor/panel brightness */
+#define XF86XK_MonBrightnessDown 0x1008FF03 /* Monitor/panel brightness */
+#define XF86XK_KbdLightOnOff 0x1008FF04 /* Keyboards may be lit */
+#define XF86XK_KbdBrightnessUp 0x1008FF05 /* Keyboards may be lit */
+#define XF86XK_KbdBrightnessDown 0x1008FF06 /* Keyboards may be lit */
// end of XF86keysyms.h
@@ -5019,6 +5024,11 @@ static const KeySym KeyTbl[] = { // keyboard mapping table
XF86XK_LaunchB, Qt::Key_LaunchD,
XF86XK_LaunchC, Qt::Key_LaunchE,
XF86XK_LaunchD, Qt::Key_LaunchF,
+ XF86XK_MonBrightnessUp, Qt::Key_MonBrightnessUp,
+ XF86XK_MonBrightnessDown, Qt::Key_MonBrightnessDown,
+ XF86XK_KbdLightOnOff, Qt::Key_KeyboardLightOnOff,
+ XF86XK_KbdBrightnessUp, Qt::Key_KeyboardBrightnessUp,
+ XF86XK_KbdBrightnessDown, Qt::Key_KeyboardBrightnessDown,
0, 0
};
diff --git a/src/kernel/qevent.cpp b/src/kernel/qevent.cpp
index c428966..ef730c1 100644
--- a/src/kernel/qevent.cpp
+++ b/src/kernel/qevent.cpp
@@ -1140,6 +1140,11 @@ Qt::ButtonState QKeyEvent::stateAfter() const
\value Key_LaunchD
\value Key_LaunchE
\value Key_LaunchF
+ \value Key_MonBrightnessUp
+ \value Key_MonBrightnessDown
+ \value Key_KeyboardLightOnOff
+ \value Key_KeyboardBrightnessUp
+ \value Key_KeyboardBrightnessDown
\value Key_MediaLast
diff --git a/src/kernel/qkeysequence.cpp b/src/kernel/qkeysequence.cpp
index 7263d4a..42ddc8b 100644
--- a/src/kernel/qkeysequence.cpp
+++ b/src/kernel/qkeysequence.cpp
@@ -160,6 +160,11 @@ static struct {
{ Qt::Key_LaunchD, QT_TRANSLATE_NOOP( "QAccel", "Launch (D)" ) },
{ Qt::Key_LaunchE, QT_TRANSLATE_NOOP( "QAccel", "Launch (E)" ) },
{ Qt::Key_LaunchF, QT_TRANSLATE_NOOP( "QAccel", "Launch (F)" ) },
+ { Qt::Key_MonBrightnessUp, QT_TRANSLATE_NOOP( "QAccel", "Monitor Brightness Up" ) },
+ { Qt::Key_MonBrightnessDown, QT_TRANSLATE_NOOP( "QAccel", "Monitor Brightness Down" ) },
+ { Qt::Key_KeyboardLightOnOff, QT_TRANSLATE_NOOP( "QAccel", "Keyboard Light On Off" ) },
+ { Qt::Key_KeyboardBrightnessUp,QT_TRANSLATE_NOOP( "QAccel", "Keyboard Brightness Up" ) },
+ { Qt::Key_KeyboardBrightnessDown, QT_TRANSLATE_NOOP( "QAccel", "Keyboard Brightness Down" ) },
// --------------------------------------------------------------
// More consistent namings
diff --git a/src/kernel/qnamespace.h b/src/kernel/qnamespace.h
index d414d02..1c51385 100644
--- a/src/kernel/qnamespace.h
+++ b/src/kernel/qnamespace.h
@@ -726,6 +726,11 @@ public:
Key_LaunchD = 0x10af,
Key_LaunchE = 0x10b0,
Key_LaunchF = 0x10b1,
+ Key_MonBrightnessUp = 0x010b2,
+ Key_MonBrightnessDown = 0x010b3,
+ Key_KeyboardLightOnOff = 0x010b4,
+ Key_KeyboardBrightnessUp = 0x010b5,
+ Key_KeyboardBrightnessDown = 0x010b6,
Key_MediaLast = 0x1fff,