scancodes.h

来自「瑞萨M16C编写的模拟PS2主机与标准键盘通讯程序.完整的工程文件,测试可用.」· C头文件 代码 · 共 83 行

H
83
字号
// PS2 scancodes - adapted from Atmel's AVR313 appnote, heavily modified#ifndef __SCANCODES_H#define __SCANCODES_H#include "kb.h"#include "machine.h"// Indexes into the next table#define PS2_SIMPLE_INDEX 0#define PS2_SHIFTED_INDEX 1// Total size (in bytes) of the scan codes table#define PS2_TABLE_SIZE 51// Table of scan codesstatic const u8 ps2_key_table[ ] = {  0x0d, 0x0e, 0x15, 0x16, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x21,          0x22, 0x23, 0x24, 0x25, 0x26, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,  0x2e, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x3a, 0x3b, 0x3c,  0x3d, 0x3e, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x49, 0x4a,  0x4b, 0x4c, 0x4d, 0x4e, 0x52, 0x54, 0x55, 0x5a, 0x5b, 0x5d,  0x66};// Table of keys corresponding to scan codes (without shift and with shift)static const u8 ps2_key_map[][ 2 ] ={  KB_TAB, KB_TAB,               '`', '~',                     'q', 'Q',                     '1', '!',                     'z', 'Z',                     's', 'S',                     'a', 'A',                     'w', 'W',                     '2', '@',                     'c', 'C',                     'x', 'X',                     'd', 'D',                     'e', 'E',                     '4', '$',                     '3', '#',                     ' ', ' ',                     'v', 'V',                     'f', 'F',                     't', 'T',                     'r', 'R',                     '5', '%',                     'n', 'N',                     'b', 'B',                     'h', 'H',                     'g', 'G',                     'y', 'Y',                     '6', '^',                     'm', 'M',                     'j', 'J',                     'u', 'U',                     '7', '&',                     '8', '*',                     ',', '<',                     'k', 'K',                     'i', 'I',                     'o', 'O',                     '0', ')',                     '9', '(',                     '.', '>',                     '/', '?',                     'l', 'L',                     ';', ':',                     'p', 'P',                     '-', '_',                     '\'', '"',                    ']', '{',                     '=', '+',                     KB_NL, KB_NL,                 ']', '}',                     '\\', '|',                    KB_BACKSPACE, KB_BACKSPACE  };#endif

⌨️ 快捷键说明

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