diff -Naur gpm-1.19.6.old/contrib/control/gpm_has_mouse_control.c gpm-1.19.6/contrib/control/gpm_has_mouse_control.c
--- gpm-1.19.6.orig/contrib/control/gpm_has_mouse_control.c     1970-01-01 01:00:00.000000000 +0100
+++ gpm-1.19.6/control/control/gpm_has_mouse_control.c  2004-08-09 18:41:53.000000000 +0200
@@ -0,0 +1,20 @@
+#include <sys/fcntl.h>
+#include <sys/kd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+
+int main (int argc, char **argv)
+{
+    int  fd;
+    int  mode;
+    fd = open ("/dev/tty0", O_RDONLY);
+    if (fd == -1)
+       fd = open ("/dev/vc/0", O_RDONLY);
+    if (fd == -1)
+       perror ("open");
+    if (ioctl (fd, KDGETMODE, &mode) != 0)
+       perror ("ioctl");
+    exit(mode);
+}
+
diff -Naur gpm-1.19.6.old/contrib/control/Makefile gpm-1.19.6/contrib/control/Makefile
--- gpm-1.19.6.orig/contrib/control/Makefile    1970-01-01 01:00:00.000000000 +0100
+++ gpm-1.19.6/contrib/control/Makefile 2004-08-09 18:41:53.000000000 +0200
@@ -0,0 +1,5 @@
+all: gpm_has_mouse_control.c
+       gcc -o gpm_has_mouse_control -Wall gpm_has_mouse_control.c
+
+clean:
+       -rm -f gpm_has_mouse_control

