bewing wrote:
I know nothing about the .NET inpout32.dll. However, it scares me that you are reading shorts from Out32 at the bottom -- especially with that 32 in the name of both functions. Are you certain that both Inp32 and Out32 transmit BYTES only? Because if there are extra 0 value bytes being sent to port 0x60 when you do an Out32, then that will totally screw up everything.
I'm aware that these ports should receive bytes only.
The 32 does not mean that i'm sending/receiving 32bit values, it has to do with the supported architecture.
I also managed to perfectly send keys using this DLL.
bewing wrote:
Also, are you sure that you initialized the mouse successfully, to send 4 byte packets? You got all the proper ACKs during the process? 3 byte packets is default. Somehow, I expect that you are skipping that part -- which is OK -- but you should limit packets to 3 bytes.
I didn't any mouse initialization, i tryed to use the mouse_install() posted above, and i got the same results, so i guess the problem isn't there.
bewing wrote:
Also, are you sure that there is no keyboard handler that is eating bytes from port 0x60 at the same time that you are trying to grab mouse bytes? (It seems to me that you will have no choice at all, but to integrate both drivers together.)
I'm starting to think that this may be the problem... i dont have any keyboard handlers, at least i didnt included any...
I'm running a .net 2.0 program, maybe something is screweing up the process, it seems that that every command i issue, i always receive a 0xFE reply instead of 0xFA..
bewing wrote:
Also, regarding these 0xFE bytes that are coming in -- is the 0x20 bit set on the byte that you read from port 0x64? Or are the 0xFE bytes coming from the KEYBOARD?
I get 0x22 when reading the por 0x64, so yes 0x20 is set.
After writting 0xD4 to the port 0x64 i should receive a 0xFA ack right?
Well again i get 0xFE... these resends probably mean that something is not letting me comunicate with the mouse.
But the critical problem seems to be here:
//Send CMD GET PACK to mouse
while ((Inp32(0x64) & 0x21) != 0x21) ; //Wait aux data
ack = Inp32(0x60);
I get 0xFE instead of 0xFA... so i'm not able to read the packets...
My mouse is connected thru USB, but i guess this is not the problem...
Btw the code i posted it's not mine i found it on other site and i don't fully understand it..
How would i write a send click/move for instance? (this is my main goal..)
EDIT: After issuing the enable mouse (0xA8) i managed to receive an ack to read the packets. Later i restarted the pc and the same code no longer worked...
My guess is that it has something to do with the mouse initialization, maybe i should not be using the streaming mode (default)?