PDA

View Full Version : Askey plugin bug solved



meaculpa
November 23rd, 2002, 05:06 AM
The askey plugin recognize bad some button of remote control.
I've modify dll in file the original function SendKey() with the follow routine
and now work well.
void SendKey(int key)
{
// Convert to Hex

char Buffer[100];

unsigned int pippo;

pippo = (unsigned int) key;

Buffer[0] =char(48 + ((pippo>>12) & 0x7));

Buffer[1] =char(48 + ((pippo>>9) & 0x7));

Buffer[2] =char(48 + ((pippo>>6) & 0x7));

Buffer[3] =char(48 + ((pippo>>3) & 0x7));

Buffer[4] =char(48 + ((pippo ) & 0x7));

SendString(Buffer);
}

Ron
November 23rd, 2002, 10:38 AM
Thanks!! Could you upload a compiled .dll so people can test your modification ?

Ron
November 24th, 2002, 01:54 AM
I've received your email and uploaded the compiled version to the download section. The sources have been uploaded to the developers section. Thanks for contributing.

janboehm
March 24th, 2003, 02:01 AM
I do not want to be picky, but seriusly want to ask:
This routine claims to conert to Hex (was in the original code). But looking at this patch, isn't it actually converting to OCT now? See the "& 0x7"? Is this intended?

Jan



void SendKey(int key)
{
// Convert to Hex

...
Buffer[0] =char(48 + ((pippo>>12) & 0x7));
...
}

Palladium
March 24th, 2003, 04:47 AM
Pardon, But Im an Studying C++ Programmer. I see you used an Array with 100 Entries, but only uset 5 of them, Hardcoded. Why is this? (PM Me if itll take more then one post to explain please)

Ron
March 24th, 2003, 06:55 AM
that does seem to be octal... feel free to suggest a modified version. ;-)

janboehm
March 25th, 2003, 02:00 AM
I guess it is an occasion for re-unifying the generic bt8x8 code. I had used this patch in Win98 and on WinXP. Mind you need an additional include of stdlib.h

Jan

void SendKey(int key)
{
// Convert to Hex
char Buffer[100];
itoa(key, Buffer, 16);
SendString(Buffer);
}