?? get_keys.h
字號:
#define TRUE 1
#define FAULSE 0
uchar key=0;
uchar scan;
/**********************delay*********************************/
void delay(void)
{
int l;
char m;
for (l=0;l<400;l++)
for (m=0;m<5;m++);
}
/****************check if any key pressed*********************/
bit CheckState(void)
{
bit state=0;
P3=0x0F; //scan key
if(P3!=0x0F)state=TRUE; //check if any key pressed
else state=FAULSE;
return(state);
}
/****************** check which key pressed*****************/
uchar GetKeys(void)
{
uchar column,line;
scan=0xFE;
while((scan&0x10)!=0)
{
P3=scan;
if((P3&0xF0)!=0xF0) //corrent line have key pressed
{
column=~(P3|0x0F);
line=~(scan|0xF0);
key=column+line;
return(key); //return the location of the
//key which is pressed
}
else scan=(scan<<1)|0x01; //if the pressed key is not on the
//corrent line, scan next line
}
return(0);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -