mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 13:16:31 +00:00
🆕 用户态解析键盘扫描码
This commit is contained in:
22
user/libs/libKeyboard/keyboard.h
Normal file
22
user/libs/libKeyboard/keyboard.h
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
// 128个按键, 每个按键包含普通按键和shift+普通按键两种状态
|
||||
#define NUM_SCAN_CODES 0x80
|
||||
#define MAP_COLS 2
|
||||
|
||||
#define PAUSE_BREAK 1
|
||||
#define PRINT_SCREEN 2
|
||||
#define OTHER_KEY 4 // 除了上面两个按键以外的功能按键(不包括下面的第三类按键)
|
||||
#define FLAG_BREAK 0X80
|
||||
|
||||
/**
|
||||
* @brief 从键盘设备文件中获取键盘扫描码
|
||||
*
|
||||
*/
|
||||
int keyboard_get_scancode(int fd);
|
||||
|
||||
/**
|
||||
* @brief 解析键盘扫描码
|
||||
*
|
||||
*/
|
||||
int keyboard_analyze_keycode(int fd);
|
Reference in New Issue
Block a user