summaryrefslogtreecommitdiffstats
path: root/usr.sbin/kbdcontrol
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>1995-01-12 11:47:05 +0000
committersos <sos@FreeBSD.org>1995-01-12 11:47:05 +0000
commit44bbcce7055c41e1f0201b527a5a6feebea0d0a5 (patch)
tree4740a2fc78a60464f13d1978d7d296c90dc2b652 /usr.sbin/kbdcontrol
parent20b24b646b29083dc2c0864b2d12a136a9cac89b (diff)
downloadFreeBSD-src-44bbcce7055c41e1f0201b527a5a6feebea0d0a5.zip
FreeBSD-src-44bbcce7055c41e1f0201b527a5a6feebea0d0a5.tar.gz
First round in syscons update. Several new features has been added:
No kernel config options anymore besides keyboard language layout. Virtual consoles are now dynamically allocated, no NCONS anymore. Software cursor blinking/nonblinking. Visual bell for laptops (don't beep at meetings :-). Cursor/bell default type setable via config "flags" instead of as defines. Cursor/bell type setable via ioctl's. New video modes 80x30 80x60 for some laptops, and those with multisync monitors. Scroll-lock history (length currently fixed at 100 lines). Lots of cleanups, some only commented out for now (will goaway soon). Support for new features in vidcontrol/kbdcontrol. Updated manpages.
Diffstat (limited to 'usr.sbin/kbdcontrol')
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.110
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.c54
2 files changed, 38 insertions, 26 deletions
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.1 b/usr.sbin/kbdcontrol/kbdcontrol.1
index 6451036..40c31d1 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.1
+++ b/usr.sbin/kbdcontrol/kbdcontrol.1
@@ -31,7 +31,12 @@ characteristics etc.
The following command line options are supported.
.TP
.BI "\-b\ " [ duration.pitch ]
-Set the bell duration and pitch values.
+Set the bell duration and pitch values. Argument may also be one of
+.BI "normal"
+which set sound parameters back to normal values, or
+.BI "visual"
+which set the bell to visual mode, ie flashes the screen instead.
+
.TP
.BI "\-r\ " [ delay.repeat | slow | fast | normal ]
Set keyboard
@@ -72,6 +77,5 @@ Report when found.
.BR vidcontrol (1) ,
.BR keyboard (4) ,
.BR screen (4) ,
-.BR /sys/i386/conf/SYSCONS
.SH AUTHORS
-Søren Schmidt (sos@login.dkuug.dk)
+Søren Schmidt (sos@FreeBSD.org)
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c
index 24349ae..9679523 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.c
+++ b/usr.sbin/kbdcontrol/kbdcontrol.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1994 Søren Schmidt
+ * Copyright (c) 1994-1995 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,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: kbdcontrol.c,v 1.1 1994/08/17 08:59:34 sos Exp $
+ * $Id: kbdcontrol.c,v 1.2 1994/10/25 20:50:41 swallace Exp $
*/
#include <ctype.h>
@@ -86,10 +86,9 @@ nextarg(int ac, char **av, int *indp, int oc)
char *
mkfullname(const char *s1, const char *s2, const char *s3)
{
-static char *buf = NULL;
-static int bufl = 0;
-int f;
-
+ static char *buf = NULL;
+ static int bufl = 0;
+ int f;
f = strlen(s1) + strlen(s2) + strlen(s3) + 1;
if (f > bufl)
@@ -421,14 +420,17 @@ set_functionkey(char *keynumstr, char *string)
void
set_bell_values(char *opt)
{
- int duration, pitch;
+ int bell, duration, pitch;
- if (!strcmp(opt, "normal"))
- duration = 1, pitch = 15;
+ if (!strcmp(opt, "visual"))
+ bell = 1, duration = 1, pitch = 800;
+ else if (!strcmp(opt, "normal"))
+ bell = 0, duration = 1, pitch = 800;
else {
int n;
char *v1;
-
+
+ bell = 0;
duration = strtol(opt, &v1, 0);
if ((duration < 0) || (*v1 != '.'))
goto badopt;
@@ -443,9 +445,14 @@ badopt:
}
if (verbose)
- fprintf(stderr, "setting bell values to %d.%d\n",
- duration, pitch);
- fprintf(stderr, "[=%d;%dB", pitch, duration);
+ if (bell)
+ fprintf(stderr, "setting visual bell\n");
+ else
+ fprintf(stderr, "setting bell values to %d.%d\n",
+ duration, pitch);
+ ioctl(0, CONS_BELLTYPE, &bell);
+ if (!bell)
+ fprintf(stderr, "[=%d;%dB", pitch, duration);
}
@@ -501,16 +508,17 @@ badopt:
usage()
{
fprintf(stderr,
-"Usage: kbdcontrol -b duration.pitch (set bell duration & pitch)\n"
-" -d (dump keyboard map to stdout)\n"
-" -l filename (load keyboard map file)\n"
-" -f <N> string (set function key N to send <string>)\n"
-" -F (set function keys back to default)\n"
-" -r delay.repeat (set keyboard delay & repeat rate)\n"
-" -r slow (set keyboard delay & repeat to slow)\n"
-" -r normal (set keyboard delay & repeat to normal)\n"
-" -r fast (set keyboard delay & repeat to fast)\n"
-" -v (verbose)\n"
+"Usage: kbdcontrol -b duration.pitch (set bell duration & pitch)\n"
+" -b normal | visual (set bell to visual type)\n"
+" -d (dump keyboard map to stdout)\n"
+" -l filename (load keyboard map file)\n"
+" -f <N> string (set function key N to send <string>)\n"
+" -F (set function keys back to default)\n"
+" -r delay.repeat (set keyboard delay & repeat rate)\n"
+" -r slow (set keyboard delay & repeat to slow)\n"
+" -r normal (set keyboard delay & repeat to normal)\n"
+" -r fast (set keyboard delay & repeat to fast)\n"
+" -v (verbose)\n"
);
}
OpenPOWER on IntegriCloud