name.c

来自「开源的键盘模拟程序」· C语言 代码 · 共 50 行

C
50
字号
/*    keyboard emulator project    Copyright (C) 1998-2003 Reznic Valery <valery_reznic@users.sourceforge.net>     This program is free software; you can redistribute it and/or modify    it under the terms of the GNU Library General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.     This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details. */#include <string.h>#include "kbde_name.inc"#define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))const char *kbde_key_to_name(int key_code){   if ( (key_code <= 0) && key_code >= ARRAYSIZE(Names) ) return NULL;   return Names[key_code]; }int kbde_name_to_key(const char *name){   int key_code;   if (name == 0) return 0;   for (key_code = 0; key_code < ARRAYSIZE(Names); key_code++) {      if (Names[key_code] == 0) continue;      if (strcmp(Names[key_code], name) == 0) return key_code;   }   return 0; }int kbde_case_name_to_key(const char *name){   int key_code;   if (name == 0) return 0;   for (key_code = 0; key_code < ARRAYSIZE(Names); key_code++) {      if (Names[key_code] == 0) continue;      if (strcasecmp(Names[key_code], name) == 0) return key_code;   }   return 0; }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?