bool InitMouse(UINT8 ch) {
UINT8 res;
int i;
RETAILMSG__(1, (TEXT("InitMouse: ") ));
i=20; do{res = GetScanCode(ch+1); i--; }while((res==0)&&(i>0));
i=20; do{res = GetScanCode(ch+1); i--; }while((res==0)&&(i>0));
if(!SendPS2CmdCnt(ch,0xF3)) goto noinit; // Set Sample Rate
if(!SendPS2CmdCnt(ch,0xC8)) goto noinit; // decimal 200
if(!SendPS2CmdCnt(ch,0xF3)) goto noinit; // Set Sample Rate
if(!SendPS2CmdCnt(ch,0x64)) goto noinit; // decimal 100
if(!SendPS2CmdCnt(ch,0xF3)) goto noinit; // Set Sample Rate
if(!SendPS2CmdCnt(ch,0x50)) goto noinit; // decimal 80
if(!SendPS2CmdCnt(ch,0xF2)) goto noinit; // Read Device Type
if(!GetScanCodeCnt(ch,&res)) goto noinit;
SetMouseType(ch,res);
if(!SendPS2CmdCnt(ch,0xF3)) goto noinit; // Set Sample Rate
if(!SendPS2CmdCnt(ch,0xC8)) goto noinit; // decimal 200
if(!SendPS2CmdCnt(ch,0xF3)) goto noinit; // Set Sample Rate
if(!SendPS2CmdCnt(ch,0xC8)) goto noinit; // decimal 200
if(!SendPS2CmdCnt(ch,0xF3)) goto noinit; // Set Sample Rate
if(!SendPS2CmdCnt(ch,0x50)) goto noinit; // decimal 80
if(!SendPS2CmdCnt(ch,0xF2)) goto noinit; // Read Device Type
if(!GetScanCodeCnt(ch,&res)) goto noinit;
SetMouseType(ch,res);
//initialisation Mouse
if(!SendPS2CmdCnt(ch,0xE8)) goto noinit; // Set resolution
if(!SendPS2CmdCnt(ch,0x03)) goto noinit; // 8 Counts/mm
if(!SendPS2CmdCnt(ch,0xE6)) goto noinit; // Set Scaling 1:1
if(!SendPS2CmdCnt(ch,0xF3)) goto noinit; // Set Sample Rate
if(!SendPS2CmdCnt(ch,0x28)) goto noinit; // decimal 40
//if(!SendPS2CmdCnt(ch,0xF4)) goto noinit; // Enable
noinit:
SendPS2CmdCnt(ch,0xF4);
i=20; do{res = GetScanCode(ch+1); i--; }while((res==0)&&(i>0));
i=20; do{res = GetScanCode(ch+1); i--; }while((res==0)&&(i>0));
i=20; do{res = GetScanCode(ch+1); i--; }while((res==0)&&(i>0));
i=20; do{res = GetScanCode(ch+1); i--; }while((res==0)&&(i>0));
switch(dps2[ch].type) {
case T_MOUSE: RETAILMSG__(1, (TEXT("Microsoft Typern") )); break;
case T_MOUSEI: RETAILMSG__(1, (TEXT("Intel Typern") )); break;
case T_MOUSEI5: RETAILMSG__(1, (TEXT("5 button Typern") )); break;
default: RETAILMSG_(1, (TEXT("None Typern") )); break;
}
return (true);
}