1 /****************************************************************************
3 * SciTech OS Portability Manager Library
5 * ========================================================================
7 * The contents of this file are subject to the SciTech MGL Public
8 * License Version 1.0 (the "License"); you may not use this file
9 * except in compliance with the License. You may obtain a copy of
10 * the License at http://www.scitechsoft.com/mgl-license.txt
12 * Software distributed under the License is distributed on an
13 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
14 * implied. See the License for the specific language governing
15 * rights and limitations under the License.
17 * The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
19 * The Initial Developer of the Original Code is SciTech Software, Inc.
20 * All Rights Reserved.
22 * ========================================================================
27 * Description: Keyboard translation code pages for US English keyboards.
29 ****************************************************************************/
33 /*--------------------------- Global variables ----------------------------*/
35 /* This table is used for all normal key translations, and is the fallback
36 * table if the key is not found in any of the other translation tables.
37 * If the code is not found in this table, the ASCII code is set to 0 to
38 * indicate that there is no ASCII code equivalent for this key.
40 static codepage_entry_t US_normal[] = {
92 {0x37, '*'}, /* Keypad */
94 {0x4A, '-'}, /* Keypad */
95 {0x4E, '+'}, /* Keypad */
96 {0x60, 0x0D}, /* Keypad */
97 {0x61, '/'}, /* Keypad */
100 /* This table is used for when CAPSLOCK is active and the shift or ctrl
101 * keys are not down. If the code is not found in this table, the normal
102 * table above is then searched.
104 static codepage_entry_t US_caps[] = {
133 /* This table is used for when shift key is down, but the ctrl key is not
134 * down and CAPSLOCK is not active. If the code is not found in this table,
135 * the normal table above is then searched.
137 static codepage_entry_t US_shift[] = {
187 /* This table is used for when CAPSLOCK is active and the shift key is
188 * down, but the ctrl key is not. If the code is not found in this table,
189 * the shift table above is then searched.
191 static codepage_entry_t US_shiftCaps[] = {
220 /* This table is used for all key translations when the ctrl key is down,
221 * regardless of the state of the shift key and CAPSLOCK. If the code is
222 * not found in this table, the ASCII code is set to 0 to indicate that
223 * there is no ASCII code equivalent for this key.
225 static codepage_entry_t US_ctrl[] = {
263 static codepage_entry_t US_numPad[] = {
277 codepage_t _CP_US_English = {
279 US_normal, EVT_ARR_SIZE(US_normal),
280 US_caps, EVT_ARR_SIZE(US_caps),
281 US_shift, EVT_ARR_SIZE(US_shift),
282 US_shiftCaps, EVT_ARR_SIZE(US_shiftCaps),
283 US_ctrl, EVT_ARR_SIZE(US_ctrl),
284 US_numPad, EVT_ARR_SIZE(US_numPad),