/*********************
K.C.Y 1993
*********************/
#include <dos.h>
void interrupt far (*oldKBD)(void);
unsigned char scancode[128]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
unsigned char touchcode[128]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
void interrupt ScanKey()
{
unsigned char key,key2;
__emit__(0xFB);
key = inportb(0x60);
if (key>127) scancode[key-128]=0;
else if(!scancode[key]) {
scancode[key]=1;
touchcode[key]=1;
}
key2 = inportb(0x61);
key=key2;
key2=key2 | 0x80;
outportb(0x61,key2);
outportb(0x61,key);
__emit__(0xFA);
outportb(0x20,0x20);
}
void NewKey()
{
oldKBD=getvect(0x9);
setvect(0x9,ScanKey);
return;
}
void OldKey()
{
setvect(0x9,oldKBD);
return;
}
'코드' 카테고리의 다른 글
로컬에서 Ollama설치와 STT, TTS 실행해 보기 (1) | 2024.10.06 |
---|---|
inline code (0) | 2023.11.17 |
Android 적응형 배너 적용 (0) | 2022.08.07 |
Android viewBinding로 변경 (0) | 2022.08.07 |
iOS에서 admob의 SKAdNetwork적용 후 앱 승인요청 필요 정보. (0) | 2021.06.01 |