📄 kbput.c
字号:
/* CXL - Copyright (c) 1987-1989 by Mike Smedley - All Rights Reserved */
/* KBPUT.C - puts a keystroke into the CXL keyboard "buffer" */
#include <stdlib.h>
#include "cxldef.h"
#include "cxlkey.h"
int kbput(unsigned xch)
{
struct _kbuf_t *kbuf,*temp;
/* allocate space for another keypress record */
if((kbuf=malloc(sizeof(struct _kbuf_t)))==NULL) return(1);
/* find last record in linked list */
if((temp=_kbinfo.kbuf)!=NULL) for(;temp->next!=NULL;temp=temp->next);
/* add new record to end of linked list */
kbuf->next=NULL;
kbuf->prev=temp;
if(temp!=NULL) temp->next=kbuf;
/* add keypress info to new record */
kbuf->xch=xch;
/* if kbuf pointer was NULL, point it to new record */
if(_kbinfo.kbuf==NULL) _kbinfo.kbuf=kbuf;
/* return normally */
return(0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -