From 2c39500f358c3bed18311d4854e22aa058d8262c Mon Sep 17 00:00:00 2001 From: Roman Savochenko Date: Sun, 25 Oct 2020 15:56:11 +0800 Subject: kmilo: added keyboard shortcuts for fine settings of screen brightness. Signed-off-by: Roman Savochenko Signed-off-by: Michele Calgaro --- kmilo/generic/generic_monitor.cpp | 14 +++++++++++++- kmilo/generic/generic_monitor.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'kmilo') diff --git a/kmilo/generic/generic_monitor.cpp b/kmilo/generic/generic_monitor.cpp index 35bf2c5..264594f 100644 --- a/kmilo/generic/generic_monitor.cpp +++ b/kmilo/generic/generic_monitor.cpp @@ -93,7 +93,9 @@ bool GenericMonitor::init() { "SlowVolumeDown", TQt::CTRL+TQt::Key_VolumeDown, TQT_SLOT(slowVolumeDown()) }, { "Mute", TDEShortcut("XF86AudioMute"), TQT_SLOT(mute()) }, { "BrightnessUp", TDEShortcut("XF86MonBrightnessUp"), TQT_SLOT(brightnessUp()) }, - { "BrightnessDown", TDEShortcut("XF86MonBrightnessDown"), TQT_SLOT(brightnessDown()) } + { "BrightnessDown", TDEShortcut("XF86MonBrightnessDown"), TQT_SLOT(brightnessDown()) }, + { "BrightnessSlowUp", TDEShortcut("Ctrl+XF86MonBrightnessUp"), TQT_SLOT(brightnessSlowUp()) }, + { "BrightnessSlowDown", TDEShortcut("Ctrl+XF86MonBrightnessDown"), TQT_SLOT(brightnessSlowDown()) } }; ga = new TDEGlobalAccel(this, "miloGenericAccel"); @@ -334,6 +336,16 @@ void GenericMonitor::brightnessDown() brightnessChange(-1, 10); } +void GenericMonitor::brightnessSlowUp() +{ + brightnessChange(1, 1); +} + +void GenericMonitor::brightnessSlowDown() +{ + brightnessChange(-1, 1); +} + void GenericMonitor::brightnessChange(int direction, int step) { if (!tdepowersave) diff --git a/kmilo/generic/generic_monitor.h b/kmilo/generic/generic_monitor.h index b5d6897..e92bac6 100644 --- a/kmilo/generic/generic_monitor.h +++ b/kmilo/generic/generic_monitor.h @@ -66,6 +66,8 @@ public slots: void mute(); void brightnessUp(); void brightnessDown(); + void brightnessSlowUp(); + void brightnessSlowDown(); void launchMail(); void launchBrowser(); void launchSearch(); -- cgit v1.2.1