URI:
       Allow mediakeys to be used while the screen is locked - slock - glitch version of slock
  HTML git clone https://git.drkhsh.at/slock.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 3cadf35e50b0e05191e901b29a992c99d7969948
   DIR parent 0965ca5abb4c4e611b969e628e93d35b10602f91
  HTML Author: drkhsh <me@drkhsh.at>
       Date:   Wed, 10 Jan 2024 10:27:44 +0100
       
       Allow mediakeys to be used while the screen is locked
       
       This patch allows using the following keys to be used while the screen
       is locked:
       
       XF86AudioPlay
       XF86AudioStop
       XF86AudioPrev
       XF86AudioNext
       XF86AudioRaiseVolume
       XF86AudioLowerVolume
       XF86AudioMute
       XF86AudioMicMute
       XF86MonBrightnessDown
       XF86MonBrightnessUp
       
       https://tools.suckless.org/slock/patches/mediakeys/
       
       Diffstat:
         M slock.c                             |      13 +++++++++++++
       
       1 file changed, 13 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/slock.c b/slock.c
       @@ -18,6 +18,7 @@
        #include <X11/keysym.h>
        #include <X11/Xlib.h>
        #include <X11/Xutil.h>
       +#include <X11/XF86keysym.h>
        #include <Imlib2.h>
        
        #include "arg.h"
       @@ -161,6 +162,18 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
                                    IsPrivateKeypadKey(ksym))
                                        continue;
                                switch (ksym) {
       +      case XF86XK_AudioPlay:
       +      case XF86XK_AudioStop:
       +      case XF86XK_AudioPrev:
       +      case XF86XK_AudioNext:
       +      case XF86XK_AudioRaiseVolume:
       +      case XF86XK_AudioLowerVolume:
       +      case XF86XK_AudioMute:
       +      case XF86XK_AudioMicMute:
       +      case XF86XK_MonBrightnessDown:
       +      case XF86XK_MonBrightnessUp:
       +        XSendEvent(dpy, DefaultRootWindow(dpy), True, KeyPressMask, &ev);
       +        break;
                                case XK_Return:
                                        passwd[len] = '\0';
                                        errno = 0;