aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/kbdcontrol
diff options
context:
space:
mode:
authorKazutaka YOKOTA <yokota@FreeBSD.org>1998-08-03 09:12:39 +0000
committerKazutaka YOKOTA <yokota@FreeBSD.org>1998-08-03 09:12:39 +0000
commit2aa0aafb2d0f2a6fb36c1f2abb19aaa6e50f832f (patch)
tree284207586326026fe632e33c5a1706c433b2648a /usr.sbin/kbdcontrol
parent30f3a4598b1cb45c4ca55512eea15f184b786f82 (diff)
downloadsrc-2aa0aafb2d0f2a6fb36c1f2abb19aaa6e50f832f.tar.gz
src-2aa0aafb2d0f2a6fb36c1f2abb19aaa6e50f832f.zip
- 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)
Notes
Notes: svn path=/head/; revision=38044
Diffstat (limited to 'usr.sbin/kbdcontrol')
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.12
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.c18
2 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.1 b/usr.sbin/kbdcontrol/kbdcontrol.1
index 603d6e4aa840..5c786661de17 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 ef53ab85d2c0..6f8c56aa3a34 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);