/*
* Copyright (c) 1996 Gordon W. Ross
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Keyboard translation tables. These tables contain
* "Key symbols" (or "keysyms", to use X terminology).
* The key symbol space is divided into "classes" where
* the high 8 bits determine the symbol class, and the
* low 8 bits are interpreted in a way specific to each
* class. The simplest class is ASCII, which is defined
* as class zero in order to simplify table definition.
*
* For convenience in the driver, all keysyms that
* deserve autorepeat are below 0x8000. The driver
* uses the following macro to determine if a keysym
* should NOT get autorepeat.
*/
#define KEYSYM_NOREPEAT(sym) ((sym) & 0x8000)
/*
* The ACSII class. Low 8 bits are the character.
*/
#define KEYSYM_ASCII 0
/*
* The "special" class.
* We don't expect to receive any of these often,
* except for KEYSYM_NOP. All can be ignored,
* because HW_ERR, LAYOUT, RESET, are all handled
* at a lower layer, before the translation code.
*/
#define KEYSYM_SPECIAL 0x8300
#define KEYSYM_NOP 0x8300
#define KEYSYM_OOPS 0x8301
#define KEYSYM_HOLE 0x8302
#define KEYSYM_HW_ERR 0x8307 /* kbd sent 0x7e */
#define KEYSYM_LAYOUT 0x830e /* kbd sent 0xfe */
#define KEYSYM_RESET 0x830f /* kbd sent 0xff */
/*
* The string entry class.
* The low 4 bits select one of the entries from
* the string table. (see kbd_stringtab[])
* By default, the string table has ANSI movement
* sequences for the arrow keys.
*/
#define KEYSYM_STRING 0x0500
/*
* Modifier symbols, to set/clear/toggle a modifier
* The low 5 bits define the position of a modifier
* bit to be cleared, set, or inverted. The meanings
* of the modifier bit positions are defined below.
*/
#define KEYSYM_CLRMOD 0x9000
#define KEYSYM_SETMOD 0x9100
#define KEYSYM_INVMOD 0x9200
#define KEYSYM_ALL_UP 0x9300
struct keyboard {
u_short *k_release; /* Key released */
u_short *k_control; /* Ctrl is down */
u_short *k_normal; /* No shifts */
u_short *k_shifted; /* Shift is down */
};
extern char kbd_stringtab[16][10];
extern unsigned short kbd_numlock_map[64];