/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
#ifndef lint
#ident "%Z%%M% %I% %E% SMI"
#endif
/*
* Copyright (c) 1988 by Sun Microsystems, Inc.
*/
#include <ctype.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
typedef enum {
} smtype_t;
typedef struct {
char *sm_name;
int sm_mask;
} smentry_t;
{ "base", 0, SM_NORMAL },
};
/*ARGSUSED*/
int
int argc;
char **argv;
{
register int kbdfd;
register int keystation;
register int shift;
int ktype;
register int allsame;
return (1);
}
perror("dumpkeys: ioctl(KIOCTYPE)");
return (1);
}
/* if no keyboard detected, or ascii terminal, exit silently */
exit(0);
/*
* See which shift masks are valid for this keyboard.
* We do that by trying to get the entry for keystation 0 and that
* shift mask; if the "ioctl" fails, we assume it's because the shift
* mask is invalid.
*/
}
/*
* Loop until we get an EINVAL, so we don't have to know
* how big the table might be.
*/
for (keystation = 0; ; keystation++) {
return (0);
perror("dumpkeys: KIOCGKEY");
return (1);
}
}
}
/*
* See if all the "normal" entries (all but the Num Lock and Up
* entries) are the same.
*/
allsame = 1;
allsame = 0;
break;
}
}
}
if (allsame) {
/*
* All of the "normal" entries are the same; just print
* "all".
*/
(void) printf(" all ");
printentry(&keyentry[0]);
} else {
/*
* The normal entries aren't all the same; print them
* individually.
*/
(void) printf(" %s ",
}
}
}
/*
* This key is a "hole"; if either the Num Lock or Up
* entry isn't a "hole", print it.
*/
case SM_NUMLOCK:
case SM_UP:
!= HOLE) {
(void) printf(" %s ",
}
break;
}
}
} else {
/*
* This entry isn't a "hole"; if the Num Lock entry
* isn't NONL (i.e, if Num Lock actually does
* something) print it, and if the Up entry isn't NOP
* (i.e., if up transitions on this key actually do
* something) print it.
*/
case SM_NUMLOCK:
!= NONL) {
(void) printf(" %s ",
}
break;
case SM_UP:
!= NOP) {
(void) printf(" %s ",
}
break;
}
}
}
(void) printf("\n");
}
}
static char *shiftkeys[] = {
"capslock",
"shiftlock",
"leftshift",
"rightshift",
"leftctrl",
"rightctrl",
"meta", /* not used */
"top", /* not used */
"cmd", /* reserved */
"altgraph",
"alt",
"numlock",
};
static char *buckybits[] = {
"metabit",
"systembit",
};
static char *funnies[] = {
"nop",
"oops",
"hole",
"reset",
"error",
"idle",
"compose",
"nonl",
};
static char *fa_class[] = {
"fa_umlaut",
"fa_cflex",
"fa_tilde",
"fa_cedilla",
"fa_acute",
"fa_grave",
};
typedef struct {
char *string;
char *name;
{ "\033[H", "homearrow" },
{ "\033[A", "uparrow" },
{ "\033[B", "downarrow" },
{ "\033[D", "leftarrow" },
{ "\033[C", "rightarrow" },
};
sizeof (builtin_strings[0]))
static char *fkeysets[] = {
"lf",
"rf",
"tf",
"bf",
};
static char *padkeys[] = {
"padequal",
"padslash",
"padstar",
"padminus",
"padsep",
"pad7",
"pad8",
"pad9",
"padplus",
"pad4",
"pad5",
"pad6",
"pad1",
"pad2",
"pad3",
"pad0",
"paddot",
"padenter",
};
static void
register struct kiockeymap *kio;
{
register int fkeyset;
register int i;
register int c;
case 0x0:
else
break;
case SHIFTKEYS >> 8:
if (entry < NSHIFTKEYS)
else
break;
case BUCKYBITS >> 8:
if (entry < NBUCKYBITS)
else
break;
case FUNNY >> 8:
else
break;
case FA_CLASS >> 8:
else
break;
case STRING >> 8:
else {
(void) printf("\"");
for (i = 0;
i++)
printchar(c, '"');
(void) printf("\"");
}
break;
case FUNCKEYS >> 8:
else
break;
case PADKEYS >> 8:
else
break;
default:
break;
}
}
static void
int character;
int delim;
{
switch (character) {
case '\n':
(void) printf("'\\n'");
break;
case '\t':
(void) printf("'\\t'");
break;
case '\b':
(void) printf("'\\b'");
break;
case '\r':
(void) printf("'\\r'");
break;
case '\v':
(void) printf("'\\v'");
break;
case '\\':
(void) printf("'\\\\'");
break;
default:
(void) printf("'\\'");
} else {
if (character < 040)
else
}
break;
}
}