*** edit TESTED and it works ****
Now If I read this right, ANY key would work so if "a" for example is your left key, it would be
/sendkey down ctrl
/sendkey down a
/sendkey up a
/sendkey up ctrl
Ill test it later today.
BTW you workin on a rogue macro?
Here is the code out of the core program
[ L124RD insists on code brackets ]
Code: Select all
// ***************************************************************************
// Function: SendKey
// Description: Our '/sendkey' command
// Sends a key up or down
// Usage: /sendkey <u|d> <key>
// ***************************************************************************
VOID SendKey(PSPAWNINFO pChar, PCHAR szLine)
{
WORD i;
CHAR Arg1[MAX_STRING];
CHAR Arg2[MAX_STRING];
GetArg(Arg1,szLine,1);
GetArg(Arg2,szLine,2);
if ((Arg1[0]==0) || (Arg2[0]==0) || ((!strnicmp(Arg1,"down",strlen(Arg1))) && (!strnicmp(Arg1,"up",strlen(Arg1))))) {
//TODO: User Spew
DebugSpew("Bad SendKey command: %s",szLine);
return;
}
for (i=0;gDiKeyID[i].szName[0];i++) {
if (!stricmp(gDiKeyID[i].szName,Arg2)) {
PKEYPRESS pNext = (PKEYPRESS)malloc(sizeof(KEYPRESS));
pNext->KeyId = i;
pNext->Pressed = !strnicmp(Arg1,"down",strlen(Arg1));
pNext->pNext = NULL;
//DebugSpew("SendKey - Queuing '%s' as %s",gDiKeyID[i].szName,Arg1);
if (!gKeyStack) {
gKeyStack = pNext;
return;
} else {
PKEYPRESS pList = gKeyStack;
while (pList->pNext) pList = pList->pNext;
pList->pNext = pNext;
return;
}
}
}
//TODO: User Spew
DebugSpew("Unknown key: %s",Arg2);
return;
}