📄 rdaccno.c
字号:
/******************************************* * * * 在x列y行处读一长length的字符串 * * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * * * * 遇回车结束,长度放在length中. * * * *******************************************/#include "../inc/screen.h"rdaccno(x,y,string,length)int x,y,length;char *string;{ int i,ch; char str[81]; if(x < 0 || x > 79-length || y < 0 || y > 24 || length < 1 || length>80) return(ERR); i = 0; for(i = 0; i < length; i++) { str[i] = BLANK; } str[length] = NUL; i = 0; scp(x,y); do{ ch = wgetch(); switch(ch) { case 'q': case 'Q': case '+': case 'e': case 'E': if(i==0) return(EXIT); else beep(1); break; case CR: case LF: break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if(i < length) { str[i] = ch; i++; putchar(ch); } else beep(1); break; case BLANK: case '.': case 'h': case 'H': case BS: if(i > 0) { i--; str[i] = BLANK; scp(x + i,y); putchar(BLANK); scp(x + i,y); } else beep(1); break; case TAB: return(ABORT); case ESC: return(BKABORT); case AC_UPPER: return(UPPER); case AC_DOWN: return(DOWN); case AC_LEFT: return(LEFT); case AC_RIGHT: return(RIGHT); case AC_HOME: return(HOME); default: beep(1); } }while(ch != CR && ch != LF); if(i) wstrcpy(str,string,length); else i = QUIT ; return(i);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -