x_kbde.c

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

C
45
字号
/*    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 Licence 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 <kbde.h>#include <string.h>#include "kbde_code.inc"#define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))int kbde_key_press(int key_code, char *buffer){   if ( (key_code <= 0) && key_code >= ARRAYSIZE(MakeCodes) ) return -1;   strcpy(buffer, MakeCodes[key_code]);   return strlen(buffer); }int kbde_key_release(int key_code, char *buffer){   if ( (key_code <= 0) && key_code >= ARRAYSIZE(BreakCodes) ) return -1;   strcpy(buffer, BreakCodes[key_code]);   return strlen(buffer); }int kbde_key_press_release(int key_code, char *buffer){   if ( (key_code <= 0) && key_code >= ARRAYSIZE(BreakCodes) ) return -1;   strcpy(buffer, MakeCodes [key_code]);   strcat(buffer, BreakCodes[key_code]);   return strlen(buffer);}

⌨️ 快捷键说明

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