1 /* $NetBSD: adb_usb_map.c,v 1.2 2014/11/08 16:52:35 macallan Exp $ */ 2 3 /*- 4 * Copyright (c) 2006 Michael Lorenz 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 * POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 #include <sys/cdefs.h> 30 __KERNEL_RCSID(0, "$NetBSD: adb_usb_map.c,v 1.2 2014/11/08 16:52:35 macallan Exp $"); 31 32 #include <sys/param.h> 33 #include <sys/device.h> 34 35 #include <dev/wscons/wsksymvar.h> 36 37 keysym_t adb_to_usb[] = { 38 /* 0, KS_a */ 4, 39 /* 1, KS_s */ 22, 40 /* 2, KS_d */ 7, 41 /* 3, KS_f */ 9, 42 /* 4, KS_h */ 11, 43 /* 5, KS_g */ 10, 44 /* 6, KS_z */ 29, 45 /* 7, KS_x */ 27, 46 /* 8, KS_c */ 6, 47 /* 9, KS_v */ 25, 48 /* 10, KS_paragraph */ 53, 49 /* 11, KS_b */ 5, 50 /* 12, KS_q */ 20, 51 /* 13, KS_w */ 26, 52 /* 14, KS_e */ 8, 53 /* 15, KS_r */ 21, 54 /* 16, KS_y */ 28, 55 /* 17, KS_t */ 23, 56 /* 18, KS_1 */ 30, 57 /* 19, KS_2 */ 31, 58 /* 20, KS_3 */ 32, 59 /* 21, KS_4 */ 33, 60 /* 22, KS_6 */ 35, 61 /* 23, KS_5 */ 34, 62 /* 24, KS_equal */ 46, 63 /* 25, KS_9 */ 38, 64 /* 26, KS_7 */ 36, 65 /* 27, KS_minus */ 45, 66 /* 28, KS_8 */ 37, 67 /* 29, KS_0 */ 39, 68 /* 30, KS_bracketright */ 48, 69 /* 31, KS_o */ 18, 70 /* 32, KS_u */ 24, 71 /* 33, KS_bracketleft */ 47, 72 /* 34, KS_i */ 12, 73 /* 35, KS_p */ 19, 74 /* 36, KS_Return */ 40, 75 /* 37, KS_l */ 15, 76 /* 38, KS_j */ 13, 77 /* 39, KS_apostrophe */ 52, 78 /* 40, KS_k */ 14, 79 /* 41, KS_semicolon */ 51, 80 /* 42, KS_backslash */ 50, 81 /* 43, KS_comma */ 54, 82 /* 44, KS_slash */ 56, 83 /* 45, KS_n */ 17, 84 /* 46, KS_m */ 16, 85 /* 47, KS_period */ 55, 86 /* 48, KS_Tab */ 43, 87 /* 49, KS_space */ 44, 88 /* 50, KS_grave */ 53, 89 /* 51, KS_Delete */ 42, 90 /* 52, KS_KP_Enter */ 88, 91 /* 53, KS_Escape */ 41, 92 /* 54, KS_Control_L */ 224, 93 /* 55, KS_Cmd */ 227, /* left meta */ 94 /* 56, KS_Shift_L */ 225, 95 /* 57, KS_Caps_Lock */ 57, 96 /* 58, KS_Option */ 226, 97 /* 59, KS_Left */ 80, 98 /* 60, KS_Right */ 79, 99 /* 61, KS_Down */ 81, 100 /* 62, KS_Up */ 82, 101 /* 63 */ 0, 102 /* 64 */ 0, 103 /* 65, KS_KP_Decimal */ 99, 104 /* 66 */ 0, 105 /* 67, KS_KP_Multiply */ 85, 106 /* 68 */ 0, 107 /* 69, KS_KP_Add */ 87, 108 /* 70 */ 0, 109 /* 71, KS_Num_Lock */ 83, 110 /* 72 */ 0, 111 /* 73 */ 0, 112 /* 74 */ 0, 113 /* 75, KS_KP_Divide */ 84, 114 /* 76, KS_KP_Enter */ 88, 115 /* 77 */ 0, 116 /* 78, KS_KP_Subtract */ 86, 117 /* 79 */ 0, 118 /* 80 */ 0, 119 /* 81, KS_KP_Equal */ 46, /* no KP_EQUAL on USB? */ 120 /* 82, KS_KP_Insert, 0 */ 98, 121 /* 83, KS_KP_End, 1 */ 89, 122 /* 84, KS_KP_Down, 2 */ 90, 123 /* 85, KS_KP_Next, 3 */ 91, 124 /* 86, KS_KP_Left, 4 */ 92, 125 /* 87, KS_KP_Begin 5 */ 93, 126 /* 88, KS_KP_Right 6 */ 94, 127 /* 89, KS_KP_Home 7 */ 95, 128 /* 90 */ 0, 129 /* 91, KS_KP_Up 8 */ 96, 130 /* 92, KS_KP_Prior 9 */ 97, 131 /* 93, KS_backslash */ 100, 132 /* 94, KS_underscore */ 45, 133 /* 95, KS_KP_Delete . */ 99, 134 /* 96, KS_f5 */ 62, 135 /* 97, KS_f6 */ 63, 136 /* 98, KS_f7 */ 64, 137 /* 99, KS_f3 */ 60, 138 /* 100, KS_f8 */ 65, 139 /* 101, KS_f9 */ 66, 140 /* 102 */ 0, 141 /* 103, KS_f11 */ 68, 142 /* 104 */ 0, 143 /* 105, KS_Print_Screen */ 70, 144 /* 106, KS_KP_Enter */ 88, 145 /* 107, KS_Hold_Screen */ 71, 146 /* 108 */ 0, 147 /* 109, KS_f10 */ 67, 148 /* 110 */ 0, 149 /* 111, KS_f12 */ 69, 150 /* 112 */ 0, 151 /* 113, KS_Pause */ 72, 152 /* 114, KS_Insert */ 73, 153 /* 115, KS_Home */ 74, 154 /* 116, KS_Prior */ 75, 155 /* 117, KS_BackSpace */ 76, 156 /* 118, KS_f4 */ 61, 157 /* 119, KS_End */ 77, 158 /* 120, KS_f2 */ 59, 159 /* 121, KS_Next */ 78, 160 /* 122, KS_f1 */ 58, 161 /* 123, KS_Shift_R */ 229, 162 /* 124, KS_Alt_R */ 230, 163 /* 125, KS_Control_R */ 228, 164 /* 126 */ 0, 165 /* 127, KS_Cmd_Debugger */ 102 166 }; 167