📄 rkb.c
字号:
/* remote keybord & screen
Project must include
commplus.c
infrared.c
cplib.lib */
#include <stdio.h>
#include <conio.h>
#include <process.h>
#include <commplus.h>
#include <infrared.h>
extern _stklen = 4096u; /* it very useful to reduce memory in HT-1800 */
extern _heaplen = 4096u; /* both stack & heap length must be set */
int main()
{
int akey;
unsigned char cm;
unsigned char p;
unsigned int baudtmp, baud;
int exitloop = 0;
unsigned char ab, st;
unsigned long b;
unsigned char p1;
unsigned char iroldstat;
if (!ComPlsInstalled())
{
if (InstallComPls(0) == 2)
{
cprintf("BIOS Setting for COM1 or COM2 Error!!!!\r\n\n");
return 0;
}
}
printf("\nBaudRate:");
scanf("%ld",&b);
scanf("%c",&akey);
printf("Port(1/2):");
scanf("%c",&p1);
scanf("%c",&akey);
printf("Input ...");
GetCommMode(&cm, &p, &baud);
if (b >= 115200)
baudtmp = 0xFFF0;
else
baudtmp = (int)b;
if (p1 == 2)
{
if (b == 9600)
{
iroldstat = IRPowerCtrl(5);
SetIRMFreq(153840);
}
if (b == 19200)
{
iroldstat = IRPowerCtrl(5);
SetIRMFreq(307680);
}
}
SetCommMode(3, p1-1, baudtmp);
EnableRx(0);
exitloop = 0;
akey = 0;
do
{
if (kbhit())
{
akey = getch();
if (akey != 27)
{
if (!exitloop)
printf("\n");
exitloop = -1;
PutAuxByte((char)akey);
printf("%c",akey);
}
}
if (ExistAuxBGot(&ab, &st))
{
if (ab == 13)
printf("\n");
exitloop = 0;
printf("%c",ab);
}
}while (akey != 27);
SetCommMode(cm, p, baud);
iroldstat = IRPowerCtrl(0);
SetIRMFreq(0);
DisableRx();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -