diff options
author | yokota <yokota@FreeBSD.org> | 2000-01-12 12:30:33 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 2000-01-12 12:30:33 +0000 |
commit | d7a68849c148b5b010836c7f0204f35e8c609465 (patch) | |
tree | 0bb4b6407b3d6a985d895dff3260d28e567fa771 /usr.sbin | |
parent | 639e3cda8a1ad1f67c22408c63e3a929b4d7ebb2 (diff) | |
download | FreeBSD-src-d7a68849c148b5b010836c7f0204f35e8c609465.zip FreeBSD-src-d7a68849c148b5b010836c7f0204f35e8c609465.tar.gz |
Make the mouse cursor char code configurable via the CONS_MOUSECTL
ioctl.
By popular demand.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/vidcontrol/vidcontrol.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c index d34ff7b..1e81cf5 100644 --- a/usr.sbin/vidcontrol/vidcontrol.c +++ b/usr.sbin/vidcontrol/vidcontrol.c @@ -33,6 +33,7 @@ static const char rcsid[] = #include <ctype.h> #include <err.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -57,10 +58,11 @@ struct vid_info info; static void usage() { - fprintf(stderr, "%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: vidcontrol [-r fg bg] [-b color] [-c appearance] [-d] [-l scrmap]", -" [-i adapter | mode] [-L] [-m on|off] [-f size file]", -" [-s number] [-t N|off] [-x] [mode] [fgcol [bgcol]] [show]"); +" [-i adapter | mode] [-L] [-M char] [-m on|off]", +" [-f size file] [-s number] [-t N|off] [-x] [mode]", +" [fgcol [bgcol]] [show]"); exit(1); } @@ -406,6 +408,22 @@ set_border_color(char *arg) } void +set_mouse_char(char *arg) +{ + struct mouse_info mouse; + long l; + + l = strtol(arg, NULL, 0); + if ((l < 0) || (l > UCHAR_MAX)) { + warnx("argument to -M must be 0 through %d", UCHAR_MAX); + return; + } + mouse.operation = MOUSE_MOUSECHAR; + mouse.u.mouse_char = (int)l; + ioctl(0, CONS_MOUSECTL, &mouse); +} + +void set_mouse(char *arg) { struct mouse_info mouse; @@ -555,7 +573,7 @@ main(int argc, char **argv) info.size = sizeof(info); if (ioctl(0, CONS_GETINFO, &info) < 0) err(1, "must be on a virtual console"); - while((opt = getopt(argc, argv, "b:c:df:i:l:Lm:r:s:t:x")) != -1) + while((opt = getopt(argc, argv, "b:c:df:i:l:LM:m:r:s:t:x")) != -1) switch(opt) { case 'b': set_border_color(optarg); @@ -579,6 +597,9 @@ main(int argc, char **argv) case 'L': load_default_scrnmap(); break; + case 'M': + set_mouse_char(optarg); + break; case 'm': set_mouse(optarg); break; |