‘壹’ C语言键盘无法打数字时怎么用程序打出来任意数字比如10或100.
调用 win32 API,,,,,模拟按键 keybd_event
keybd_event(9,0,0,0) #Tab
keybd_event(17,0,KEYEVENT_KEYUP,0) #Realize the Ctrl button
keybd_event(19,0,KEYEVENT_KEYUP,0) #Realize the Tab button
‘贰’ 大一C语言字符串九宫格输入法
给出的参考并没判断每个字符,只判断了空格后1个位置不是数字的情况哈,懒了
#include<stdio.h>
#include<string.h>
intmain()
{
//储存九宫格的字符串指针数组
char*ninepalace[10]={"0","1,.?!","2ABC","3DEF","4GHI",
"5JKL","6MNO","7PQRS","8TUV","9WXYZ"};
//从键盘获取输入
charbuf[100]={0};
gets_s(buf,sizeof(buf));//允许输入空格
//解析输入并输出
char*child=buf,*pos=buf,*tmp=NULL;
intnumber=0,len=0;
do
{
pos=strchr(child,'');//寻找当前字符串第一个空格的位置"ABC"
if(pos!=NULL)
{
*pos='