⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keybd.h

📁 一个小型的操作系统,采用gcc进行开发,几千行的代码,方便初学者学习
💻 H
字号:
/**  Snixos Project version 1.0, 2003.6*  (C) Copyright 2003,2004,2005 Jockeyson,KeqiangGao <Snallie@tom.com>*  All Rights Reserved.*  Distributed under the terms of the GNU General Public License.**  This program is a free and open source software and you can redistribute *  it and/or modify it under the terms of the GNU General Public License as*  published by the Free Software Foundation. As no any liablity is assumed *  for any incidental or consequential damages in connection with the *  information or program fragments contained herein,so any exception arised*  is at your own risk. It is ABSOLUTELY WITHOUT ANY WARRANTY.*  Bug report please send to Snallie@tom.com .*//*  keybd.h: header file for keyboard.c in Snixos Project  Author : Snallie@tom.com  Time   : 2003.6*/#define LOCKED 1#define PRESSED 1#define RELEASED 0typedef unsigned char byte;unsigned char ascTab[] = {    /* 0-9  */ ' ', 0x1b, '1', '2', '3', '4', '5', '6', '7', '8',    /*10-19 */ '9', '0', '-', '=', '\b', '\t', 'q', 'w', 'e', 'r',    /*20-29 */ 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', ' ',    /*30-39 */ 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';',    /*40-49 */ '\'', '`', ' ', '\\', 'z', 'x', 'c', 'v', 'b', 'n',    /*50-59 */ 'm', ',', '.', '/', ' ', '*', ' ', ' ', ' ', ' ',    /*60-69 */ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',    /*70-79 */ ' ', ' ', ' ', ' ', '-', ' ', ' ', ' ', '+', ' '};unsigned char shiftMap[] = {    ' ', 0x1b, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',    '\b', '\t',    'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', ' ',    'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~', ' ', '|',    'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?'};typedef struct status {    unsigned char LeftShift:1;    unsigned char RightShift:1;    unsigned char LeftCtrl:1;    unsigned char RightCtrl:1;    unsigned char LeftAlt:1;    unsigned char RightAlt:1;    unsigned char CapsLock:1;    unsigned char NumLock:1;    unsigned char ScrollLock:1;    unsigned char ScanExtE0:1;} keyStatus;keyStatus ks;/*  port 60h b0 is ScrollLock, b1 is NumLock, b2 is CapsLock */byte kbdLEDS;typedef struct kbuf {    char scan;    char ascii;} keybuf;keybuf keyBufs[KBSIZE];int keyHead = 0;int keyTail = 0;#define keybdTail (keyBufs+keyTail)#define keybdHead (keyBufs+keyHead)static void moveHead();static void moveTail();void kbdLedOnOff(unsigned char i);

⌨️ 快捷键说明

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