/*
* 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
*/
/*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _KBTRANS_LOWER_H
#define _KBTRANS_LOWER_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* This structure describes the state of the keyboard.
* and also specifies the keytables.
*/
struct kbtrans_lower {
/* Generating pre-4.1 events? */
int kbtrans_compat;
/* key to repeat in TR_ASCII mode */
/* Current state of the LED's */
/* Pointer to keyboard maps */
/* Current shift state */
/*
* Various mapping tables.
*/
signed char *kbtrans_compose_map;
/* Strings sent by various keys */
/* Num lock table */
unsigned char *kbtrans_numlock_table;
/*
* The kbtrans structure specifies the state of the
* stream.
*/
};
/*
* Different functions must be called based upon the type of translation
* mode. Each translation mode such as TR_ASCII, TR_EVENT, TR_NONE, etc.
* has an instance of this structure.
*/
struct keyboard_callback {
/*
* Raw (untranslated) keypress
*/
/*
* Raw (untranslated) keyrelease
*/
/*
* Keypress
*/
/*
* Keyrelease
*/
/*
* Initialize a repeat character
*/
/*
* Cancel a repeat character
*/
/*
* Process the led state change
*/
};
/*
* Process a scancode. This routine will call the functions in
* keyboard_callback to handle the translated key.
*/
void
struct kbtrans_lower *lower,
struct keyboard_callback *cb,
);
/*
* This routine finds the entry for the specified keycode based on the
* specified shift mask.
*/
unsigned short *
struct kbtrans_lower *lower,
);
/*
* Debug printing
*/
#ifndef DPRINTF
#ifdef DEBUG
(((l) >= kbtrans_errlevel) && ((m) & kbtrans_errmask) ? \
kbtrans_dprintf args : \
(void) 0)
#else
#endif
#endif
/*
* Severity levels for printing
*/
/*
* Masks
*/
#ifdef DEBUG
extern int kbtrans_errmask;
extern int kbtrans_errlevel;
extern void kbtrans_dprintf(void *, const char *fmt, ...);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _KBTRANS_LOWER_H */