Posted: Mon Nov 19, 2007 11:41 pm
sprhawk:
Can you examine your descriptor somehow as its received on your host?
I could resolve some of my problems with the great tool evtest under linux.
It shows first the supported events of a device in a summary and then just all actual events as they come in.. very helpfull. for example with this I saw setting "0x00, 0xff" as maximum value was not seen as the same as sending just "0xff". (though the register addreses were set accordingly for 1 or 2 byte)
Grendel:
thanks a lot for this example and the very clear bit map. but I have to admit that it still doesn't work at my side. I get only 8 bits transmitted properly. When I send 10bit they are chopped up similar like 16bit. I probably shift the bits wrong. I used nearly the same setup as you for my x and y coordinates, there is just one full byte for the mouse buttons infront of x and y:
After X and Y, I fill the report descripter properly with 4 bits, to get 4 * 8 in total. How do you put your 10bit values together in the buffer?
Also can someone explain for me what the differences between logical and physical maxiums are, when used for an absolute device? I don't get it! I just set them the same, in this case to 10bit max each.
Oli
Can you examine your descriptor somehow as its received on your host?
I could resolve some of my problems with the great tool evtest under linux.
It shows first the supported events of a device in a summary and then just all actual events as they come in.. very helpfull. for example with this I saw setting "0x00, 0xff" as maximum value was not seen as the same as sending just "0xff". (though the register addreses were set accordingly for 1 or 2 byte)
Grendel:
thanks a lot for this example and the very clear bit map. but I have to admit that it still doesn't work at my side. I get only 8 bits transmitted properly. When I send 10bit they are chopped up similar like 16bit. I probably shift the bits wrong. I used nearly the same setup as you for my x and y coordinates, there is just one full byte for the mouse buttons infront of x and y:
Code: Select all
//set mouse button one down
reportBuffer[0] = 0x01;
//shifting x and y for 10bit values
reportBuffer[1] = (x & 0xff); //lower 8 bits of x
reportBuffer[2] = ((y & 0x3f) << 2) | (8 >> (x & 0x300)); //high 2 bit of x to the right, 6 low bits of y to the left
// 0x3f= 11 1111 0x300 = 11 0000 0000
reportBuffer[3] = (6 >> (y & 0x3C0)); //0x3c0 = 11 1100 0000 //put the remaining 4 bits of y at the left end
After X and Y, I fill the report descripter properly with 4 bits, to get 4 * 8 in total. How do you put your 10bit values together in the buffer?
Also can someone explain for me what the differences between logical and physical maxiums are, when used for an absolute device? I don't get it! I just set them the same, in this case to 10bit max each.
Oli