http://ftp.x.org/contrib/applications/xscreensaver-3.10.tar.gz
[xscreensaver] / hacks / screenhack.c
index 0e1c678e1039dc5451afec54ab5eca1ec7d14140..eb9d7185e0058dd0cd3e3e1c042d8a94f26d1fcb 100644 (file)
@@ -38,6 +38,7 @@
 #include <X11/Shell.h>
 #include <X11/StringDefs.h>
 #include <X11/Xutil.h>
+#include <X11/keysym.h>
 
 #ifdef __sgi
 # include <X11/SGIScheme.h>    /* for SgiUseSchemes() */
@@ -58,6 +59,7 @@
 
 char *progname;
 XrmDatabase db;
+XtAppContext app;
 Bool mono_p;
 
 static XrmOptionDescRec default_options [] = {
@@ -188,7 +190,10 @@ screenhack_handle_event (Display *dpy, XEvent *event)
             c == 3 ||  /* ^C */
             c == 27)   /* ESC */
           exit (0);
+        else if (! (keysym >= XK_Shift_L && keysym <= XK_Hyper_R))
+          XBell (dpy, 0);  /* beep for non-chord keys */
       }
+      break;
     case ButtonPress:
       XBell (dpy, 0);
       break;
@@ -236,7 +241,6 @@ screenhack_handle_events (Display *dpy)
 int
 main (int argc, char **argv)
 {
-  XtAppContext app;
   Widget toplevel;
   Display *dpy;
   Window window;