xref: /openbsd-src/sys/dev/adb/keyboard.h (revision 263ceb67d383d28f23221fca4f3a32400748e791)
1*263ceb67Sshadchin /*	$OpenBSD: keyboard.h,v 1.5 2011/06/13 16:29:11 shadchin Exp $	*/
2305d9e87Smiod /*	$NetBSD: keyboard.h,v 1.1 1998/05/15 10:15:54 tsubai Exp $	*/
3305d9e87Smiod 
4305d9e87Smiod /*-
5305d9e87Smiod  * Copyright (C) 1993	Allen K. Briggs, Chris P. Caputo,
6305d9e87Smiod  *			Michael L. Finch, Bradley A. Grantham, and
7305d9e87Smiod  *			Lawrence A. Kesteloot
8305d9e87Smiod  * All rights reserved.
9305d9e87Smiod  *
10305d9e87Smiod  * Redistribution and use in source and binary forms, with or without
11305d9e87Smiod  * modification, are permitted provided that the following conditions
12305d9e87Smiod  * are met:
13305d9e87Smiod  * 1. Redistributions of source code must retain the above copyright
14305d9e87Smiod  *    notice, this list of conditions and the following disclaimer.
15305d9e87Smiod  * 2. Redistributions in binary form must reproduce the above copyright
16305d9e87Smiod  *    notice, this list of conditions and the following disclaimer in the
17305d9e87Smiod  *    documentation and/or other materials provided with the distribution.
18305d9e87Smiod  * 3. All advertising materials mentioning features or use of this software
19305d9e87Smiod  *    must display the following acknowledgement:
20305d9e87Smiod  *	This product includes software developed by the Alice Group.
21305d9e87Smiod  * 4. The names of the Alice Group or any of its members may not be used
22305d9e87Smiod  *    to endorse or promote products derived from this software without
23305d9e87Smiod  *    specific prior written permission.
24305d9e87Smiod  *
25305d9e87Smiod  * THIS SOFTWARE IS PROVIDED BY THE ALICE GROUP ``AS IS'' AND ANY EXPRESS OR
26305d9e87Smiod  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27305d9e87Smiod  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28305d9e87Smiod  * IN NO EVENT SHALL THE ALICE GROUP BE LIABLE FOR ANY DIRECT, INDIRECT,
29305d9e87Smiod  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30305d9e87Smiod  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31305d9e87Smiod  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32305d9e87Smiod  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33305d9e87Smiod  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34305d9e87Smiod  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35305d9e87Smiod  */
36305d9e87Smiod 
37305d9e87Smiod #define ADBK_CAPSLOCK	0x39
38a1387c96Smiod #define	ADBK_RESET	0x7f
39305d9e87Smiod 
40305d9e87Smiod #define ADBK_KEYVAL(key)	((key) & 0x7f)
41305d9e87Smiod #define ADBK_PRESS(key)		(((key) & 0x80) == 0)
42305d9e87Smiod #define ADBK_KEYDOWN(key)	(key)
43305d9e87Smiod #define ADBK_KEYUP(key)		((key) | 0x80)
44