000
24.12.2005, 18:24 Uhr
~chris123
Gast
|
Mein Konsolenprogram soll einen tastendruck simmulieren... aber ich denke es sollte auch kürzer gehen...sonst werd ich noch verrückt...
if (strcmp (argv[2],"1") == 0) {key=0x30;} if (strcmp (argv[2],"2") == 0) {key=0x31;} if (strcmp (argv[2],"3") == 0) {key=0x32;} if (strcmp (argv[2],"4") == 0) {key=0x33;} if (strcmp (argv[2],"5") == 0) {key=0x34;} if (strcmp (argv[2],"6") == 0) {key=0x35;} if (strcmp (argv[2],"7") == 0) {key=0x36;} if (strcmp (argv[2],"8") == 0) {key=0x37;} if (strcmp (argv[2],"9") == 0) {key=0x38;} ... if (strcmp (argv[2],"a") == 0) {key=0x41;} ... ... ... ... keybd_event(key, 0, 0, 0); // drücken |