diff options
author | yokota <yokota@FreeBSD.org> | 1998-08-03 09:12:39 +0000 |
---|---|---|
committer | yokota <yokota@FreeBSD.org> | 1998-08-03 09:12:39 +0000 |
commit | 5c2620bec22a3e812b85199753da08fe1124e5bf (patch) | |
tree | a178ec2bec000b42013269226c5ecfbbee7048b1 /usr.sbin | |
parent | c54fb2066b22309961c10122920190978bdfc104 (diff) | |
download | FreeBSD-src-5c2620bec22a3e812b85199753da08fe1124e5bf.zip FreeBSD-src-5c2620bec22a3e812b85199753da08fe1124e5bf.tar.gz |
- Set bell pitch in hertz and duration in msecs.
The change corresponds to syscons.c 1.268.
PR: bin/6037
Submitted by: Kouichi Hirabayashi (kh@eve.mogami-wire.co.jp)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/kbdcontrol/kbdcontrol.1 | 2 | ||||
-rw-r--r-- | usr.sbin/kbdcontrol/kbdcontrol.c | 18 |
2 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.1 b/usr.sbin/kbdcontrol/kbdcontrol.1 index 603d6e4..5c78666 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.1 +++ b/usr.sbin/kbdcontrol/kbdcontrol.1 @@ -37,7 +37,7 @@ characteristics etc. The following command line options are supported: .Bl -tag -width indent .It Fl b Ar duration.pitch | Ar belltype -Set the bell duration and pitch values. +Set the bell duration in miliseconds and pitch in hertz. If a .Ar belltype argument is specified, it may be one of diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index ef53ab8..6f8c56a 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -28,7 +28,7 @@ #ifndef lint static const char rcsid[] = - "$Id: kbdcontrol.c,v 1.13 1998/01/12 23:53:26 yokota Exp $"; + "$Id: kbdcontrol.c,v 1.14 1998/05/05 19:02:01 des Exp $"; #endif /* not lint */ #include <ctype.h> @@ -768,10 +768,15 @@ set_bell_values(char *opt) { int bell, duration, pitch; + bell = 0; + if (!strncmp(opt, "quiet.", 6)) { + bell = 2; + opt += 6; + } if (!strcmp(opt, "visual")) - bell = 1, duration = 1, pitch = 800; + bell |= 1; else if (!strcmp(opt, "normal")) - bell = 0, duration = 1, pitch = 800; + duration = 5, pitch = 800; else { char *v1; @@ -786,10 +791,13 @@ badopt: warnx("argument to -b must be DURATION.PITCH"); return; } + if (pitch != 0) + pitch = 1193182 / pitch; /* in Hz */ + duration /= 10; /* in 10 m sec */ } ioctl(0, CONS_BELLTYPE, &bell); - if (!bell) + if ((bell & ~2) == 0) fprintf(stderr, "[=%d;%dB", pitch, duration); } @@ -858,7 +866,7 @@ static void usage() { fprintf(stderr, "%s\n%s\n%s\n", -"usage: kbdcontrol [-dFx] [-b duration.pitch | belltype]", +"usage: kbdcontrol [-dFx] [-b duration.pitch | [quiet.]belltype]", " [-r delay.repeat | speed] [-l mapfile] [-f # string]", " [-h size] [-L mapfile]"); exit(1); |