1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
void kcout(char* myout) {
int length=strlen(myout);
for( int i=0; i<length; i++)
{
switch(myout[i])
{
case '!':
case '@':
case '#':
case '$':
case '^':
case '&':
case '*':
case '(':
case ')':
case '_':
case '+':
case '~':
case '{':
case '}':
case '|':
case '"':
case ':':
case '<':
case '>':
case '?':
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
case 'S':
case 'T':
case 'U':
case 'V':
case 'W':
case 'X':
case 'Y':
case 'Z':
case '%':
keybd_event(VK_SHIFT,0x10,0,0); // shift depress
keybd_event(VkKeyScan(myout[i]),0,0,0); //depress
keybd_event(VkKeyScan(myout[i]),0, KEYEVENTF_KEYUP,0); // release!
keybd_event(VK_SHIFT,0x10,KEYEVENTF_KEYUP,0);// shift release
break;
default:
keybd_event(VkKeyScan(myout[i]),0,0,0); //depress
keybd_event(VkKeyScan(myout[i]),0, KEYEVENTF_KEYUP,0); // release!
break;
}
}
}
void ret()
{
keybd_event(VK_RETURN,0x0D,0,0); //enter depress!
keybd_event(VK_RETURN,0x0D, KEYEVENTF_KEYUP,0); // enter release!
}
|