summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vidcontrol/vidcontrol.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>1996-06-21 07:20:13 +0000
committersos <sos@FreeBSD.org>1996-06-21 07:20:13 +0000
commit62906f837cec531382b1e2219cf86f9e66468ced (patch)
tree01a0044fc059b82ad8d8c1005ea495755695357c /usr.sbin/vidcontrol/vidcontrol.c
parente0038ca9ca8173315d5dec855ca6f39481c99823 (diff)
downloadFreeBSD-src-62906f837cec531382b1e2219cf86f9e66468ced.zip
FreeBSD-src-62906f837cec531382b1e2219cf86f9e66468ced.tar.gz
Added new -m option, that enable / disables the mousepointer on
a textmode screen.
Diffstat (limited to 'usr.sbin/vidcontrol/vidcontrol.c')
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index bd56843..429b7e6 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1994-1995 Søren Schmidt
+ * Copyright (c) 1994-1996 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: vidcontrol.c,v 1.10 1995/03/03 21:21:24 dima Exp $
+ * $Id: vidcontrol.c,v 1.11 1995/05/30 03:52:53 rgrimes Exp $
*/
#include <ctype.h>
@@ -64,6 +64,7 @@ usage()
" -c destructive (set cursor to blinking destructive char)\n"
" -d (dump screenmap to stdout)\n"
" -l filename (load srceenmap file filename)\n"
+" -m on|off (switch mousepointer support on or off)\n"
" -L (load default screenmap)\n"
" -f DxL filename (load font, D dots wide & L lines high)\n"
" -t N (set screensaver timeout in seconds)\n"
@@ -347,6 +348,23 @@ set_border_color(char *arg)
usage();
}
+void
+set_mouse(char *arg)
+{
+ struct mouse_info mouse;
+
+ if (!strcmp(arg, "on"))
+ mouse.operation = MOUSE_SHOW;
+ else if (!strcmp(arg, "off"))
+ mouse.operation = MOUSE_HIDE;
+ else {
+ fprintf(stderr,
+ "argument to -m must either on or off\n");
+ return;
+ }
+ ioctl(0, CONS_MOUSECTL, &mouse);
+}
+
test_frame()
{
int i;
@@ -377,14 +395,14 @@ main(int argc, char **argv)
perror("Must be on a virtual console");
exit(1);
}
- while((opt = getopt(argc, argv, "b:c:df:l:Lr:t:x")) != -1)
+ while((opt = getopt(argc, argv, "b:c:df:l:Lm:r:t:x")) != -1)
switch(opt) {
- case 'c':
- set_cursor_type(optarg);
- break;
case 'b':
set_border_color(optarg);
break;
+ case 'c':
+ set_cursor_type(optarg);
+ break;
case 'd':
print_scrnmap();
break;
@@ -398,6 +416,9 @@ main(int argc, char **argv)
case 'L':
load_default_scrnmap();
break;
+ case 'm':
+ set_mouse(optarg);
+ break;
case 'r':
set_reverse_colors(argc, argv, &optind);
break;
OpenPOWER on IntegriCloud