//可以直接将这个数组复制使用
//基本上标准的键盘按键都在上面,这个是自己写程序测出来的,有什么错误之处请留言
// KBD_KEY[n][0] 是windows下的键值
// KBD_KEY[n][1] 是linux下定义的键值
int KBD_KEY[200][2]=
{
{8,KEY_BACKSPACE},
{9,KEY_TAB},
{13,KEY_ENTER},
{16,KEY_LEFTSHIFT},
{17,KEY_LEFTCTRL},
{19,KEY_PAUSE},
{20,KEY_CAPSLOCK},
{27,KEY_ESC},
{32,KEY_SPACE},
{33,KEY_PAGEUP},
{34,KEY_PAGEDOWN},
{35,KEY_END},
{36,KEY_HOME},
{37,KEY_LEFT},
{38,KEY_UP},
{39,KEY_RIGHT},
{40,KEY_DOWN},
{45,KEY_INSERT},
{46,KEY_DELETE},
{48,KEY_0}
{49,KEY_1},
{50,KEY_2},
{51,KEY_3},
{52,KEY_4},
{53,KEY_5},
{54,KEY_6},
{55,KEY_7},
{56,KEY_8},
{57,KEY_9},
{65,KEY_A},
{66,KEY_B},
{67,KEY_C},
{68,KEY_D},
{69,KEY_E},
{70,KEY_F},
{71,KEY_G},
{72,KEY_H},
{73,KEY_I},
{74,KEY_J},
{75,KEY_K},
{76,KEY_L},
{77,KEY_M},
{78,KEY_N},
{79,KEY_O},
{80,KEY_P},
{81,KEY_Q},
{82,KEY_R},
{83,KEY_S},
{84,KEY_T},
{85,KEY_U},
{86,KEY_V},
{87,KEY_W},
{88,KEY_X},
{89,KEY_Y},
{90,KEY_Z},
{91,KEY_LEFTMETA},
{93,KEY_COMPOSE},
{96,KEY_GRAVE},
{97,KEY_KP1},
{98,KEY_KP2},
{99,KEY_KP3},
{100,KEY_KP4},
{101,KEY_KP5},
{102,KEY_KP6},
{103,KEY_KP7},
{104,KEY_KP8},
{105,KEY_KP9},
{106,KEY_KPASTERISK},
{107,KEY_KPPLUS},
{109,KEY_KPMINUS},
{110,KEY_KPDOT},
{111,KEY_KPSLASH},
{112,KEY_F1},
{113,KEY_F2},
{114,KEY_F3},
{115,KEY_F4},
{116,KEY_F5},
{117,KEY_F6},
{118,KEY_F7},
{119,KEY_F8},
{120,KEY_F9},
{121,KEY_F10},
{122,KEY_F11},
{123,KEY_F2},
{144,KEY_NUMLOCK},
{145,KEY_SCROLLLOCK},
{186,KEY_SEMICOLON},
{187,KEY_EQUAL},
{188,KEY_COMMA},
{189,KEY_MINUS},
{190,KEY_DOT},
{191,KEY_SLASH},
{219,KEY_LEFTBRACE},
{210,KEY_BACKSLASH},
{221,KEY_RIGHTBRACE},
{222,KEY_APOSTROPHE},
};
-------------------------------------------------------
以下是linux 下input.h的部分代码,定义了linux下按键的值
-------------------------------------------------------
#ifndef _INPUT_H
#define _INPUT_H
#define EV_SYN 0x00
#define EV_KEY 0x01
#define EV_REL 0x02
#define EV_ABS 0x03
#define EV_MSC 0x04
#define EV_SW 0x05
#define EV_LED 0x11
#define EV_SND 0x12
#define EV_REP 0x14
#define EV_FF 0x15
#define EV_PWR 0x16
#define EV_FF_STATUS 0x17
#define EV_MAX 0x1f
#define EV_CNT (EV_MAX+1)
/*
* Synchronization events.
*/
#define SYN_REPORT 0
#define SYN_CONFIG 1
#define SYN_MT_REPORT 2
/*
* Keys and buttons
*
* Most of the keys/buttons are modeled after USB HUT 1.12
* (see http://www.usb.org/developers/hidpage).
* Abbreviations in the comments:
* AC - Application Control
* AL - Application Launch Button
* SC - System Control
*/
#define KEY_RESERVED 0
#define KEY_ESC 1
#define KEY_1 2
#define KEY_2 3
#define KEY_3 4
#define KEY_4 5
#define KEY_5 6
#define KEY_6 7
#define KEY_7 8
#define KEY_8 9
#define KEY_9 10
#define KEY_0 11
#define KEY_MINUS 12
#define KEY_EQUAL 13
#define KEY_BACKSPACE 14
#define KEY_TAB 15
#define KEY_Q 16
#define KEY_W 17
#define KEY_E 18
#define KEY_R 19
#define KEY_T 20
#define KEY_Y 21
#define KEY_U 22
#define KEY_I 23
#define KEY_O 24
#define KEY_P 25
#define KEY_LEFTBRACE 26
#define KEY_RIGHTBRACE 27
#define KEY
linux下系统键值和windows下系统键值的区别
最新推荐文章于 2024-06-11 18:31:33 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)