sending "special" characters

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

roguish
orc pawn
orc pawn
Posts: 29
Joined: Sun Jul 21, 2002 1:11 am

sending "special" characters

Post by roguish » Sun Jul 28, 2002 5:28 am

What is the command for sending control keys like shift and "ctrl", and left arrow and right arrow?

for instance:

/sendkey down ctrl
/sendkey down right
/sendkey up ctrl
/sendkey up right

Those are guesses on my part, but is there a table that is being referenced that is standard? I know and understand the moveforward (up) and move backwards (down) as /sendkey up up, etc. but am not able to find an example of the control keys.

Help would be appreciated.

Roguish

Spankinz
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sat Jul 27, 2002 8:43 am

Post by Spankinz » Tue Aug 06, 2002 8:42 am

*** 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;
}

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Tue Aug 06, 2002 11:48 am

Salutations,
Valid Keys:
1
2
3
4
5
6
7
8
9
0
-
=

Q
W
E
R
T
Y
U
I
O
P
[
]

A
S
D
F
G
H
J
K
L
;
'
`
\

Z
X
C
V
B
N
M
,
.
/
*

F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
F15

Num_0
Num_1
Num_2
Num_3
Num_4
Num_5
Num_6
Num_7
Num_8
Num_9
Num_Enter
Num_Del
Num_/
Num_-
Num_+

Up
Left
Right
Down

Home
End
Page_Up
Page_Down
Insert
Delete

Esc
Enter
Backspace
Tab
Space

Ctrl
Right_Ctrl
Shift
Right_Shift
Alt
Right_Alt

Num_Lock
Scroll_Lock
Caps_Lock
Prnt_Scrn