📄 pcvt_kbd.h
字号:
/* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. * * Copyright (c) 1992, 1993 Brian Dunford-Shore and Holger Veit. * * All rights reserved. * * This code is derived from software contributed to Berkeley by * William Jolitz and Don Ahn. * * This code is derived from software contributed to 386BSD by * Holger Veit. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Hellmuth Michaelis, * Brian Dunford-Shore and Joerg Wunsch. * 4. The name authors may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * @(#)pcvt_kbd.h, 3.20, Last Edit-Date: [Sun Apr 2 18:59:08 1995] * *//*---------------------------------------------------------------------------* * * pcvt_kbd.h VT220 Driver Keyboard Interface Header * ------------------------------------------------------ * -hm split off from pcvt_kbd.c * -hm patch from Lon Willett to fix mapping of Control-R scancode * *---------------------------------------------------------------------------*//*---------------------------------------------------------------------------* * this is one sub-entry for the table. the type can be either * "pointer to a string" or "pointer to a function" *---------------------------------------------------------------------------*/typedef struct{ u_char subtype; /* subtype, string or function */#ifdef PCVT_ALT_ENH u_short str_leng; /* if string, stringlength */#endif union what { u_char *string; /* ptr to string, null terminated */ void (*func)(void); /* ptr to function */ } what;} entry;/*---------------------------------------------------------------------------* * this is the "outer" table *---------------------------------------------------------------------------*/typedef struct{ u_short type; /* type of key */ u_short ovlindex; /* -hv- index into overload table */ entry unshift; /* normal default codes/funcs */ entry shift; /* shifted default codes/funcs */ entry ctrl; /* control default codes/funcs */#ifdef PCVT_ALT_ENH entry alt; /* normal default codes/funcs */ entry alt_shift; /* shifted default codes/funcs */ entry alt_ctrl; /* control default codes/funcs */ entry alt_ctrl_shift; /* normal default codes/funcs */#endif} Keycap_def;#define IDX0 0 /* default indexvalue into ovl table */#define STR KBD_SUBT_STR /* subtype = ptr to string */#define FNC KBD_SUBT_FNC /* subtype = ptr to function */#define CODE_SIZE 5/*---------------------------------------------------------------------------* * the overlaytable table is a static fixed size scratchpad where all the * overloaded definitions are stored. * an entry consists of a short (holding the new type attribute) and * four entries for a new keydefinition. *---------------------------------------------------------------------------*/#define OVLTBL_SIZE 64 /* 64 keys can be overloaded */#define Ovl_tbl struct kbd_ovlkeystatic Ovl_tbl *ovltbl; /* the table itself */static ovlinitflag = 0; /* the init flag for the table *//* * key codes >= 128 denote "virtual" shift/control * They are resolved before any keymapping is handled */#if PCVT_SCANSET == 2static u_char scantokey[] = {/* -0- -1- -2- -3- -4- -5- -6- -7- This layout is valid for US only *//*00*/ 0,120, 0,116,114,112,113,123, /* ?? F9 ?? F5 F3 F1 F2 F12 *//*08*/ 0,121,119,117,115, 16, 1, 0, /* ?? F10 F8 F6 F4 TAB ` ?? *//*10*/ 0, 60, 44, 0, 58, 17, 2, 0, /* ?? ALl SHl ?? CTl Q 1 ?? *//*18*/ 0, 0, 46, 32, 31, 18, 3, 0, /* ?? Z S A W 2 ?? ?? *//*20*/ 0, 48, 47, 33, 19, 5, 4, 0, /* ?? C X D E 4 3 ?? *//*28*/ 0, 61, 49, 34, 21, 20, 6, 0, /* ?? SP V F T R 5 ?? *//*30*/ 0, 51, 50, 36, 35, 22, 7, 0, /* ?? N B H G Y 6 ?? *//*38*/ 0, 0, 52, 37, 23, 8, 9, 0, /* ?? ?? M J U 7 8 ?? *//*40*/ 0, 53, 38, 24, 25, 11, 10, 0, /* ?? , K I O 0 9 ?? *//*48*/ 0, 54, 55, 39, 40, 26, 12, 0, /* ?? . / L ; P - ?? *//*50*/ 0, 0, 41, 0, 27, 13, 0, 0, /* ?? ?? " ?? [ = ?? ?? *//*58*/ 30, 57, 43, 28, 0, 29, 0, 0, /* CAP SHr ENT ] ?? \ ?? ?? *//*60*/ 0, 45, 0, 0, 0, 0, 15, 0, /* ?? NL1 ?? ?? ?? ?? BS ?? *//*68*/ 0, 93, 0, 92, 91, 0, 0, 0, /* ?? KP1 ?? KP4 KP7 ?? ?? ?? *//*70*/ 99,104, 98, 97,102, 96,110, 90, /* KP0 KP. KP2 KP5 KP6 KP8 ESC NUM *//*78*/ 122,106,103,105,100,101,125, 0, /* F11 KP+ KP3 KP- KP* KP9 LOC ?? *//*80*/ 0, 0, 0,118,127 /* ?? ?? ?? F7 SyRQ */};static u_char extscantokey[] = {/* -0- -1- -2- -3- -4- -5- -6- -7- This layout is valid for US only *//*00*/ 0,120, 0,116,114,112,113,123, /* ?? F9 ?? F5 F3 F1 F2 F12 *//*08*/ 0,121,119,117,115, 16, 1, 0, /* ?? F10 F8 F6 F4 TAB ` ?? *//*10*/ 0, 62,128, 0, 64, 17, 2, 0, /* ?? ALr vSh ?? CTr Q 1 ?? *//*18*/ 0, 0, 46, 32, 31, 18, 3, 0, /* ?? Z S A W 2 ?? ?? *//*20*/ 0, 48, 47, 33, 19, 5, 4, 0, /* ?? C X D E 4 3 ?? *//*28*/ 0, 61, 49, 34, 21, 20, 6, 0, /* ?? SP V F T R 5 ?? *//*30*/ 0, 51, 50, 36, 35, 22, 7, 0, /* ?? N B H G Y 6 ?? *//*38*/ 0, 0, 52, 37, 23, 8, 9, 0, /* ?? ?? M J U 7 8 ?? *//*40*/ 0, 53, 38, 24, 25, 11, 10, 0, /* ?? , K I O 0 9 ?? *//*48*/ 0, 54, 95, 39, 40, 26, 12, 0, /* ?? . KP/ L ; P - ?? *//*50*/ 0, 0, 41, 0, 27, 13, 0, 0, /* ?? ?? " ?? [ = ?? ?? *//*58*/ 30, 57,108, 28, 0, 29, 0, 0, /* CAP SHr KPE ] ?? \ ?? ?? *//*60*/ 0, 45, 0, 0, 0, 0, 15, 0, /* ?? NL1 ?? ?? ?? ?? BS ?? *//*68*/ 0, 81, 0, 79, 80, 0, 0, 0, /* ?? END ?? LA HOM ?? ?? ?? *//*70*/ 75, 76, 84, 97, 89, 83,110, 90, /* INS DEL DA KP5 RA UA ESC NUM *//*78*/ 122,106, 86,105,124, 85,126, 0, /* F11 KP+ PD KP- PSc PU Brk ?? *//*80*/ 0, 0, 0,118,127 /* ?? ?? ?? F7 SysRq */};#else /* PCVT_SCANSET != 2 */static u_char scantokey[] = {/* -0- -1- -2- -3- -4- -5- -6- -7- This layout is valid for US only *//*00*/ 0,110, 2, 3, 4, 5, 6, 7, /* ?? ESC 1 2 3 4 5 6 *//*08*/ 8, 9, 10, 11, 12, 13, 15, 16, /* 7 8 9 0 - = BS TAB *//*10*/ 17, 18, 19, 20, 21, 22, 23, 24, /* Q W E R T Y U I *//*18*/ 25, 26, 27, 28, 43, 58, 31, 32, /* O P [ ] ENT CTl A S *//*20*/ 33, 34, 35, 36, 37, 38, 39, 40, /* D F G H J K L ; *//*28*/ 41, 1, 44, 29, 46, 47, 48, 49, /* ' ` SHl \ Z X C V *//*30*/ 50, 51, 52, 53, 54, 55, 57,100, /* B N M , . / SHr KP* *//*38*/ 60, 61, 30,112,113,114,115,116, /* ALl SP CAP F1 F2 F3 F4 F5 *//*40*/ 117,118,119,120,121, 90,125, 91, /* F6 F7 F8 F9 F10 NUM LOC KP7 *//*48*/ 96,101,105, 92, 97,102,106, 93, /* KP8 KP9 KP- KP4 KP5 KP6 KP+ KP1 *//*50*/ 98,103, 99,104,127, 0, 45,122, /* KP2 KP3 KP0 KP. SyRq?? NL1 F11 *//*58*/ 123 /* F12 */};static u_char extscantokey[] = {/* -0- -1- -2- -3- -4- -5- -6- -7- This layout is valid for US only *//*00*/ 0,110, 2, 3, 4, 5, 6, 7, /* ?? ESC 1 2 3 4 5 6 *//*08*/ 8, 9, 10, 11, 12, 13, 15, 16, /* 7 8 9 0 - = BS TAB *//*10*/ 17, 18, 19, 20, 21, 22, 23, 24, /* Q W E R T Y U I *//*18*/ 25, 26, 27, 28,108, 64, 31, 32, /* O P [ ] KPE CTr A S *//*20*/ 33, 34, 35, 36, 37, 38, 39, 40, /* D F G H J K L ; *//*28*/ 41, 1,128, 29, 46, 47, 48, 49, /* ' ` vSh \ Z X C V *//*30*/ 50, 51, 52, 53, 54, 95, 57,124, /* B N M , . KP/ SHr KP* *//*38*/ 62, 61, 30,112,113,114,115,116, /* ALr SP CAP F1 F2 F3 F4 F5 *//*40*/ 117,118,119,120,121, 90,126, 80, /* F6 F7 F8 F9 F10 NUM Brk HOM *//*48*/ 83, 85,105, 79, 97, 89,106, 81, /* UA PU KP- LA KP5 RA KP+ END *//*50*/ 84, 86, 75, 76, 0, 0, 45,122, /* DA PD INS DEL ?? ?? NL1 F11 *//*58*/ 123, /* F12 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -