diff --git a/src/dpmsinputeventfilter.cpp b/src/dpmsinputeventfilter.cpp index 780b4dbd6d..07729aecde 100644 --- a/src/dpmsinputeventfilter.cpp +++ b/src/dpmsinputeventfilter.cpp @@ -51,6 +51,26 @@ bool DpmsInputEventFilter::wheelEvent(WheelEvent *event) bool DpmsInputEventFilter::keyEvent(KeyEvent *event) { + static constexpr std::array s_mediaKeys = { + Qt::Key::Key_MediaLast, + Qt::Key::Key_MediaNext, + Qt::Key::Key_MediaPause, + Qt::Key::Key_MediaPlay, + Qt::Key::Key_MediaPrevious, + Qt::Key::Key_MediaRecord, + Qt::Key::Key_MediaStop, + Qt::Key::Key_MediaTogglePlayPause, + Qt::Key::Key_VolumeUp, + Qt::Key::Key_VolumeDown, + Qt::Key::Key_VolumeMute, + Qt::Key::Key_MicVolumeUp, + Qt::Key::Key_MicVolumeDown, + Qt::Key::Key_MicMute, + }; + if (std::ranges::find(s_mediaKeys, event->key()) != s_mediaKeys.end()) { + // don't wake up the screens for media or volume keys + return false; + } if (event->type() == QKeyEvent::KeyPress) { notify(); } else if (event->type() == QKeyEvent::KeyRelease) {