Page 12 of 16
Posted: Sat Sep 30, 2017 7:55 pm
by The Robman
Can you document exactly what all the bits do as I didn't understand your earlier explanation, with the sign, etc.
Do you want to add any of that extra stuff to the code, like the 3000 pause, etc? Feel free to edit my combo if you like. Ask questions if there's anything in there that doesn't make sense.
Posted: Sun Oct 01, 2017 12:23 pm
by vickyg2003
After still more experimenting I found we've got the leadout time too short on both the keyboard and the mouse. When I held down a letter key, eventually it stopped working too, but on the keyboard its no big deal if you run out of repeat after a few hundred repeats. On the mouse however that was the kiss of death. I think that we are sending too many signals too close together, sending the IR processor into some kind of overflow situation causing the IR processor to freeze until the signals stopped coming.. That would account for the peculiar behavior I've been seeing. So I added all the times together on the keyboard and came up with 98000 overall frame length. I tried 98000 as the over all frame length. So I kept shorening it and when the leadout as total got down to 45056u, the mouse was still very lively and no logic needed to pad out the timing. So the timeout for a mouse should be
About the bits.
Mice used to be a mechanical. If you had an early mouse, it had 2 buttons and a rubber ball that moved two silver bars inside the housing. The mouse would transmit the number of rotations of the silver bars to indicate movement. One bar would represent the change in Y, one the change in X.
in our data we have
8 bitDevice, 5 bit checksum, 7 bit change in y, 7 bit change in X, 1 bit R and 1 bit L 5 bits ~checksum
The reason I think that there is something special about YYYY
SYY. is that that is the bit the linux driver using to deterimine the y direction and XXXX
SXX to determine the Y direction.
Jerod Wilson, the Linux Driver author seems to have found some information that I can't find.
Jerod Wilson's Comment wrote:ir-mce_kbd-decoder.c - A decoder for the RC6-ish keyboard/mouse IR protocol
* used by the Microsoft Remote Keyboard for Windows Media Center Edition,
* referred to by Microsoft's Windows Media Center remote specification docs
* as "an internal protocol called MCIR-2".
I have googled that every which way I can and it abd can't find that document.
I played around a lot with the up
It appears to be a MSB comp number
1111 011 was as slow as it goes.
1111 010 was a little faster (this is what we captured) was still very slow
1111 001 is where I ended up,
1111 000 was easy to use and nicely fast but sometimes I couldn't select the line on a menu that I wanted.
1101 011 jumped 3 lines when used on a menu, so it was really too huge a change on the y axis to be useful
1011 000 jumped 5 or 6 lines. on the menu.
The version with My simple Mouse, Robs Keyboard with JP1 support can be found
http://www.hifi-remote.com/forums/dload ... e_id=14676
Posted: Sun Oct 01, 2017 5:00 pm
by The Robman
Rather than me interpreting what you said and maybe making a mistake, could you edit my combo upgrade so that the timings and mouse codes are the best.
In the PB file, the default leadout time (ie, the 8E94h on row 27) is for the keyboard, and the #1518h (on line 48) is the mouse leadout time, so feel free to alter either of those.
Now for the individual mouse button codes, even though they are really in a 7-7-2 format, for KM I had to split them up as 8-8. As I mentioned before, the MSB (bit7) of the OBC (ie, the leftmost bit) decides whether to send the keyboard (0) or mouse (1) signal. So, if it's "1" we enter the mouse logic. Next, I check bit4 of the OBC (which is the rightmost of the first "1111/0000" string) and if it's zero, I will zero out the MSB. That still works for all the mouse data that you just posted, but you only posted UP times, did you also work out DOWN times? Does it still work for those?
EDIT: I see you edited your post while I was typing and have posted a file, so I will take a look at that.
Posted: Sun Oct 01, 2017 9:11 pm
by The Robman
So, I checked your file and it doesn't appear that you changed my combo stuff, so I have updated the combo protocol to use your new mouse leadout time and the KM file to use your new mouse codes:
http://www.hifi-remote.com/forums/dload ... e_id=14702
There's still one open question regarding the checksum formula. In each sample of data that we have, the 9th and 10th bits of the mouse code are the same, so they're always either "00" or "11", so my program to find the formula couldn't tell which bit should be used.
So to help figure this out, could you try some experiments where you change the one of the middle 2 bits in the "1111" string used by all the "left" functions.
So, try changing one of the red bits below (but not both), re-generate the checksum and see if it still works. If it does, I've picked the right bit, if it doesn't, I need to generate some more experimental data for you to try.
1111010 1
111010 00 Left UP
0000000 1
111001 00 Left
0000111 1
111000 00 Left Down
0000000 1
111011 01 drag left
1111010 1
111010 01 Drag Left Up
0000111 1
111000 01 Drag Left Down
Posted: Mon Oct 02, 2017 4:47 am
by vickyg2003
I'm sorry, I misled you. I had my time set as "As Total", you need to shorten the leadout time by the length of the signal
Code: Select all
LDW RR1C,#2e66h ;set Leadout off=23756 uS
The Robman wrote:
1111010 1111010 00 Left UP
0000000 1111001 00 Left
0000111 1111000 00 Left Down
0000000 1111011 01 drag left
1111010 1111010 01 Drag Left Up
0000111 1111000 01 Drag Left Down
I thought that as I changed each one of them should work, but neither did.
Left originally said:
Left 129 E4
So I tried
Left 128 64
Left 128 A4
and neither of them worked. I think those were the bits you asked for.
Posted: Mon Oct 02, 2017 7:15 am
by The Robman
Ok, I fixed the combo to use OffAsTotal for the mouse, give it a try.
As for the checksum, going with "1101001" as the binary for the 2nd 7-bit word, I have generated all the possible checksum values and have added them to your 2-3 KM file here:
http://www.hifi-remote.com/forums/dload ... e_id=14719
Could you try them all to see if any of them work please.
Posted: Mon Oct 02, 2017 8:41 am
by vickyg2003
7 is the charm. Pressing number 7 zooms 3 inches to the left.
Posted: Mon Oct 02, 2017 8:45 am
by The Robman
And here's a second file that uses "1011001" as the binary...
http://www.hifi-remote.com/forums/dload ... e_id=14720
Posted: Mon Oct 02, 2017 12:00 pm
by vickyg2003
Zero (0) shoots the mouse half way across the screen. It took me a while to get my head around why we were doing this, but then I remembered that the keyboard didn't use those bits because the left Windows and Alt keys were not on the 104 or so keycodes we were originally had.
Posted: Mon Oct 02, 2017 12:17 pm
by The Robman
Right, so in every example so far, bits 9 and 10 were either both set or both blank, so my program couldn't tell which one was needed for each bit of the checksum. Now that I have your 2 new results, I will be able to determine the one true formula for the checksum.
Posted: Mon Oct 02, 2017 1:29 pm
by The Robman
So, 3 out of the 5 bits changed as a result of those tests, the final formula for the checksum is (where the red bits are ones that changed):
1 , 1 2 3 4 5
2 , 6 7 8 9 10 11 12
3 , 1 2 6 7 8 9 13 14 15
4 , 3 4 6 7 10 11 13 14 16
5 , 1 3 5 6 8 10 12 13 15 16
I have updated the combo file to use these new patterns, and I have included the 2 left test codes in the KM file too, just to make sure they still work. So Vicky, please give it a whirl.
Oh, and btw, can you explain what some of the mouse commands actually do, like what is the difference between "left up", "right up" and "up"? Are the first 2 diagonal?
Posted: Mon Oct 02, 2017 2:35 pm
by vickyg2003
The Robman wrote:
Oh, and btw, can you explain what some of the mouse commands actually do, like what is the difference between "left up", "right up" and "up"? Are the first 2 diagonal?
OMG,

You really have not understood my xy access explanations, have you. I thought you were just pulling my chain.
The picture below shows an old fashioned mechanical mouse, albeit a newer 3 button version.
When you moved the mouse, the ball would roll because of the friction with the desktop mousepad. The ball would rotate the x-axis and y-axis wheels inside the mouse, depending on what direction you moved the mouse. The rotation of the X-axis a Y-axis wheels are what is being transmitted by our signals. So yea Right Up and Left Up are diagonal movements as are Left Down and Right Down. Up means you pushed the mouse away from you, down means you pulled the mouse toward you. That's why I asked you to arrange the mouse buttons in the way that I said was the only way that made sense.
Code: Select all
1 Left Up ------ 2 Up ----------- 3 Right Up
4 Left --------- 5 Click -------- 6 Right
7 Left Down ---- 8 Down --------- 9 Right Down
Posted: Mon Oct 02, 2017 2:44 pm
by The Robman
Yeah, so I was right, they're diagonal, cool.
Will you have a chance to test my combo code later? I think this could be the final version.
Posted: Mon Oct 02, 2017 2:52 pm
by vickyg2003
I went back up and found the link to the combo file, but the KM and PB files inside the zip are from September 27th. So I can't find them.
Posted: Mon Oct 02, 2017 3:55 pm
by The Robman
I just re-downloaded the file to confirm that they show the 10/2 date, and they do, so you must have done something wrong.
http://www.hifi-remote.com/forums/dload ... e_id=14702