📄 keyshell.c
字号:
#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <fcntl.h>#include <unistd.h>#include <errno.h>#include <pthread.h>#include <time.h>#include "../keyboard/get_key.h"char shell_s[]="\nkeyshell> ";/*int argc, char *argv[*/#define CMD_TPYE (0)#define PHONE_NUMBER (1)#define MAX_CMD_DEPTH (2)extern volatile int STOP ;void * keyshell(){ char cmd[256]={0,}; int i; char number[11]={0,}; gprs_init(); while(1){ printf(shell_s); fflush(stdout); scanf("%s",cmd); printf("\r\n"); //显示必要的输出 if (strncmp("q",cmd,1)==0) { printf("\nexit this program!\n"); STOP=1; break; } else if(cmd[0] != 0){ system(cmd); } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -