/bind some_key Num_+ not allowed with current parsing code

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

dweomer
a lesser mummy
a lesser mummy
Posts: 62
Joined: Thu Feb 19, 2004 3:33 pm

/bind some_key Num_+ not allowed with current parsing code

Post by dweomer » Tue Mar 16, 2004 3:05 am

Doing a /bind action_fade num_+ results in an "Invalid key combination" error message. However, this is a valid keycode name that I believe is used internally by the client. There are 2 ways to fix this, one is to make this somewhat ugly change to MQ2Main/MQ2Utilities.cpp:ParseKeyCombo at roughly line 2183

Code: Select all

for (unsigned long i=0 ; gDiKeyID[i].Id ; i++)
{
	[color=red]if ((!stricmp(text,gDiKeyID[i].szName))||(!stricmp(text,"num_")&&!stricmp("num_+",gDiKeyID[i].szName)))[/color]
	{
		Ret.Data[3]=(char)gDiKeyID[i].Id;
		break;
	}
}
Which has the potentially disconcerting side effect of allowing a mistype of num_ to be mistaken as num_+. The other fix is to disallow the + as a valid token delimiter which would in turn invalidate any configs with key combinations using + as a delimiter. (example: configs generated by /dumpbinds). To avoid the side-effect in the first solution I suppose one could write an ugly special condition check (before the input string is tokenized) for any substrings matching num_+ that do not have a corresponding substring match of num_++ at the very same index, ugh.

Well, I'll leave this to you Lax (or whomever).

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Tue Mar 16, 2004 3:13 am

Ahh another unexpected problem :)
dikeys.h

Code: Select all

	{"Num_Enter",	156},
	{"Num_Del",	83},
[color=red]
	{"Num_Slash",	181},
	{"Num_Minus",	74},
	{"Num_Plus",	78},
	{"Num_Asterisk",	55},
[/color]
That'll do. I've made that change and it's going to be in cvs.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

dweomer
a lesser mummy
a lesser mummy
Posts: 62
Joined: Thu Feb 19, 2004 3:33 pm

Post by dweomer » Tue Mar 16, 2004 3:19 am

My laziness doth show :(

Although am glad that it was an easier fix!