6386 V.3.2 virtual terminal switch remapping?

Larry Campbell campbell at redsox.bsw.com
Sun Jun 18 14:15:02 AEST 1989


The manual entry is incomplete;  you have to scrutinize kd.h carefully.
I'm glad Jim's posting (Hi, Jim!) prompted me to look this up and write
the following program (which I call kset, but you can call Nancy if you
like).

This program lets you switch consoles with Alt-F1 through Alt-F8 (instead
of the irritating Alt-Sysreq F1 through Alt-Sysreq F8);  modify to taste.
I wrote and tested it on Interactive 386/ix v2.0.1, but I assume it will
also work on the AT&T SVR3.2 release.

-----------------------------------cut here-----------------------------------
#include <stdio.h>
#include <sys/types.h>
#include <sys/at_ansi.h>
#include <sys/kd.h>

extern void exit();
extern void perror();

struct kbentry
    kbetab[] =
	{
	    { K_ALTTAB,	59, SPECIALKEY | (K_VTF + 1) },
	    { K_ALTTAB,	60, SPECIALKEY | (K_VTF + 2) },
	    { K_ALTTAB,	61, SPECIALKEY | (K_VTF + 3) },
	    { K_ALTTAB,	62, SPECIALKEY | (K_VTF + 4) },
	    { K_ALTTAB,	63, SPECIALKEY | (K_VTF + 5) },
	    { K_ALTTAB,	64, SPECIALKEY | (K_VTF + 6) },
	    { K_ALTTAB,	65, SPECIALKEY | (K_VTF + 7) },
	    { K_ALTTAB,	66, SPECIALKEY | (K_VTF + 0) },
	    { 0,         0,                        0 }
	};

main()
{
int i;

for (i = 0; kbetab[i].kb_index; i++)
    {
    if (ioctl(0, KDSKBENT, &kbetab[i]) == -1)
	{
	perror("kset: KDGKBENT ioctl failed");
	exit(1);
	}
    }
return 0;
}

-- 
Larry Campbell                          The Boston Software Works, Inc.
campbell at bsw.com                        120 Fulton Street
wjh12!redsox!campbell                   Boston, MA 02146



More information about the Comp.sys.att mailing list