kbdgen.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2010 Vojtech Horky
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00057 #ifndef USB_HIDUT_KBD_KEY
00058 
00066 #define USB_HIDUT_KBD_KEY(name, usage_id, letter, letter_caps, letter_mod1, letter_mod2)
00067 
00068 #endif
00069 
00070 #define __NONPRINT(name, usage_id) \
00071         USB_HIDUT_KBD_KEY(name, usage_id, 0, 0, 0, 0)
00072 
00073 /* US alphabet letters */
00074 USB_HIDUT_KBD_KEY(A, 0x04, 'a', 'A', 0, 0)
00075 USB_HIDUT_KBD_KEY(B, 0x05, 'b', 'B', 0, 0)
00076 USB_HIDUT_KBD_KEY(C, 0x06, 'c', 'C', 0, 0)
00077 USB_HIDUT_KBD_KEY(D, 0x07, 'd', 'D', 0, 0)
00078 USB_HIDUT_KBD_KEY(E, 0x08, 'e', 'E', 0, 0)
00079 USB_HIDUT_KBD_KEY(F, 0x09, 'f', 'F', 0, 0)
00080 USB_HIDUT_KBD_KEY(G, 0x0A, 'g', 'G', 0, 0)
00081 USB_HIDUT_KBD_KEY(H, 0x0B, 'h', 'H', 0, 0)
00082 USB_HIDUT_KBD_KEY(I, 0x0C, 'i', 'I', 0, 0)
00083 USB_HIDUT_KBD_KEY(J, 0x0D, 'j', 'J', 0, 0)
00084 USB_HIDUT_KBD_KEY(K, 0x0E, 'k', 'K', 0, 0)
00085 USB_HIDUT_KBD_KEY(L, 0x0F, 'l', 'L', 0, 0)
00086 USB_HIDUT_KBD_KEY(M, 0x10, 'm', 'M', 0, 0)
00087 USB_HIDUT_KBD_KEY(N, 0x11, 'n', 'N', 0, 0)
00088 USB_HIDUT_KBD_KEY(O, 0x12, 'o', 'O', 0, 0)
00089 USB_HIDUT_KBD_KEY(P, 0x13, 'p', 'P', 0, 0)
00090 USB_HIDUT_KBD_KEY(Q, 0x14, 'q', 'Q', 0, 0)
00091 USB_HIDUT_KBD_KEY(R, 0x15, 'r', 'R', 0, 0)
00092 USB_HIDUT_KBD_KEY(S, 0x16, 's', 'S', 0, 0)
00093 USB_HIDUT_KBD_KEY(T, 0x17, 't', 'T', 0, 0)
00094 USB_HIDUT_KBD_KEY(U, 0x18, 'u', 'U', 0, 0)
00095 USB_HIDUT_KBD_KEY(V, 0x19, 'v', 'V', 0, 0)
00096 USB_HIDUT_KBD_KEY(W, 0x1A, 'w', 'W', 0, 0)
00097 USB_HIDUT_KBD_KEY(X, 0x1B, 'x', 'X', 0, 0)
00098 USB_HIDUT_KBD_KEY(Y, 0x1C, 'y', 'Y', 0, 0)
00099 USB_HIDUT_KBD_KEY(Z, 0x1D, 'z', 'Z', 0, 0)
00100 
00101 /* Keyboard digits */
00102 USB_HIDUT_KBD_KEY(1, 0x1E, '1', '!', 0, 0)
00103 USB_HIDUT_KBD_KEY(2, 0x1F, '2', '@', 0, 0)
00104 USB_HIDUT_KBD_KEY(3, 0x20, '3', '#', 0, 0)
00105 USB_HIDUT_KBD_KEY(4, 0x21, '4', '$', 0, 0)
00106 USB_HIDUT_KBD_KEY(5, 0x22, '5', '%', 0, 0)
00107 USB_HIDUT_KBD_KEY(6, 0x23, '6', '^', 0, 0)
00108 USB_HIDUT_KBD_KEY(7, 0x24, '7', '&', 0, 0)
00109 USB_HIDUT_KBD_KEY(8, 0x25, '8', '*', 0, 0)
00110 USB_HIDUT_KBD_KEY(9, 0x26, '9', '(', 0, 0)
00111 USB_HIDUT_KBD_KEY(0, 0x27, '0', ')', 0, 0)
00112 
00113 /* More-or-less typewriter command keys */
00114 USB_HIDUT_KBD_KEY(ENTER, 0x28, '\n', 0, 0, 0)
00115 USB_HIDUT_KBD_KEY(ESCAPE, 0x29, 0, 0, 0, 0)
00116 USB_HIDUT_KBD_KEY(BACKSPACE, 0x2A, '\b', 0, 0, 0)
00117 USB_HIDUT_KBD_KEY(TAB, 0x2B, '\t', 0, 0, 0)
00118 USB_HIDUT_KBD_KEY(SPACE, 0x2C, ' ', 0, 0, 0)
00119 
00120 /* Special (printable) characters */
00121 USB_HIDUT_KBD_KEY(DASH, 0x2D, '-', '_', 0, 0)
00122 USB_HIDUT_KBD_KEY(EQUALS, 0x2E, '=', '+', 0, 0)
00123 USB_HIDUT_KBD_KEY(LEFT_BRACKET, 0x2F, '[', '{', 0, 0)
00124 USB_HIDUT_KBD_KEY(RIGHT_BRACKET, 0x30, ']', '}', 0, 0)
00125 USB_HIDUT_KBD_KEY(BACKSLASH, 0x31, '\\', '|', 0, 0)
00126 USB_HIDUT_KBD_KEY(HASH, 0x32, '#', '~', 0, 0)
00127 USB_HIDUT_KBD_KEY(SEMICOLON, 0x33, ';', ':', 0, 0)
00128 USB_HIDUT_KBD_KEY(APOSTROPHE, 0x34, '\'', '"', 0, 0)
00129 USB_HIDUT_KBD_KEY(GRAVE_ACCENT, 0x35, '`', '~', 0, 0)
00130 USB_HIDUT_KBD_KEY(COMMA, 0x36, ',', '<', 0, 0)
00131 USB_HIDUT_KBD_KEY(PERIOD, 0x37, '.', '>', 0, 0)
00132 USB_HIDUT_KBD_KEY(SLASH, 0x38, '/', '?', 0, 0)
00133 
00134 USB_HIDUT_KBD_KEY(CAPS_LOCK, 0x39, 0, 0, 0, 0)
00135 
00136 /* Function keys */
00137 __NONPRINT( F1, 0x3A)
00138 __NONPRINT( F2, 0x3B)
00139 __NONPRINT( F3, 0x3C)
00140 __NONPRINT( F4, 0x3D)
00141 __NONPRINT( F5, 0x3E)
00142 __NONPRINT( F6, 0x3F)
00143 __NONPRINT( F7, 0x40)
00144 __NONPRINT( F8, 0x41)
00145 __NONPRINT( F9, 0x42)
00146 __NONPRINT(F10, 0x43)
00147 __NONPRINT(F11, 0x44)
00148 __NONPRINT(F12, 0x45)
00149 
00150 /* Cursor movement keys & co. */
00151 __NONPRINT(PRINT_SCREEN, 0x46)
00152 __NONPRINT(SCROLL_LOCK, 0x47)
00153 __NONPRINT(PAUSE, 0x48)
00154 __NONPRINT(INSERT, 0x49)
00155 __NONPRINT(HOME, 0x4A)
00156 __NONPRINT(PAGE_UP, 0x4B)
00157 __NONPRINT(DELETE, 0x4C)
00158 __NONPRINT(END, 0x4D)
00159 __NONPRINT(PAGE_DOWN, 0x4E)
00160 __NONPRINT(RIGHT_ARROW, 0x4F)
00161 __NONPRINT(LEFT_ARROW, 0x50)
00162 __NONPRINT(DOWN_ARROW, 0x51)
00163 __NONPRINT(UP_ARROW, 0x52)
00164 
00165 
00166 
00167 
00168 /* USB_HIDUT_KBD_KEY(, 0x, '', '', 0, 0) */
00169 
00170 #undef __NONPRINT
00171 

Generated on Thu Jun 2 07:45:48 2011 for HelenOS/USB by  doxygen 1.4.7