136f50903Storek /* 2*db00d1deSbostic * Copyright (c) 1992, 1993 3*db00d1deSbostic * The Regents of the University of California. All rights reserved. 436f50903Storek * 536f50903Storek * This software was developed by the Computer Systems Engineering group 636f50903Storek * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 736f50903Storek * contributed to Berkeley. 836f50903Storek * 9b248cd2bSbostic * All advertising materials mentioning features or use of this software 10b248cd2bSbostic * must display the following acknowledgement: 11b248cd2bSbostic * This product includes software developed by the University of 12cc9a6bbbStorek * California, Lawrence Berkeley Laboratory. 13b248cd2bSbostic * 1436f50903Storek * %sccs.include.redist.c% 1536f50903Storek * 16*db00d1deSbostic * @(#)kbio.h 8.1 (Berkeley) 06/11/93 1736f50903Storek * 18cc9a6bbbStorek * from: $Header: kbio.h,v 1.4 92/11/26 01:16:32 torek Exp $ (LBL) 1936f50903Storek */ 2036f50903Storek 2136f50903Storek /* 2236f50903Storek * The following is a minimal emulation of Sun's `kio' structures 2336f50903Storek * and related operations necessary to make X11 happy (i.e., make it 2436f50903Storek * compile, and make old X11 binaries run). 2536f50903Storek */ 2636f50903Storek 2736f50903Storek /* 2836f50903Storek * The kiockey structure apparently gets and/or sets keyboard mappings. 2936f50903Storek * It seems to be kind of useless, but X11 uses it (according to the 3036f50903Storek * comments) to figure out when a Sun 386i has a type-4 keyboard but 3136f50903Storek * claims to have a type-3 keyboard. We need just enough to cause the 3236f50903Storek * appropriate ioctl to return the appropriate magic value. 3336f50903Storek * 3436f50903Storek * KIOCGETKEY fills in kio_entry from kio_station. Not sure what tablemask 3536f50903Storek * is for; X sets it before the call, so it is not an output, but we do not 3636f50903Storek * care anyway. KIOCSDIRECT is supposed to tell the kernel whether to send 3736f50903Storek * keys to the console or to X; we just send them to X whenever the keyboard 3836f50903Storek * is open at all. (XXX may need to change this later) 3936f50903Storek * 4036f50903Storek * Keyboard commands and types are defined in kbd.h as they are actually 4136f50903Storek * real hardware commands and type numbers. 4236f50903Storek */ 4336f50903Storek struct kiockey { 4436f50903Storek int kio_tablemask; /* whatever */ 4536f50903Storek u_char kio_station; /* key number */ 4636f50903Storek u_char kio_entry; /* HOLE if not present */ 4736f50903Storek char kio_text[10]; /* the silly escape sequences (unsupported) */ 4836f50903Storek }; 4936f50903Storek 5036f50903Storek #define HOLE 0x302 /* value for kio_entry to say `really type 3' */ 5136f50903Storek 5236f50903Storek #define KIOCTRANS _IOW('k', 0, int) /* set translation mode */ 5336f50903Storek /* (we only accept TR_UNTRANS_EVENT) */ 5436f50903Storek #define KIOCGETKEY _IOWR('k', 2, struct kiockey) /* fill in kio_entry */ 5536f50903Storek #define KIOCGTRANS _IOR('k', 5, int) /* get translation mode */ 5636f50903Storek #define KIOCCMD _IOW('k', 8, int) /* X uses this to ring bell */ 5736f50903Storek #define KIOCTYPE _IOR('k', 9, int) /* get keyboard type */ 5836f50903Storek #define KIOCSDIRECT _IOW('k', 10, int) /* keys to console? */ 5936f50903Storek 6036f50903Storek #define TR_UNTRANS_EVENT 3 61