Page 6 of 16

Posted: Sat Sep 09, 2017 6:35 pm
by vickyg2003
The Robman wrote:
vickyg2003 wrote:Rob, is there a 2 byte limitation on function hex?
A limitation on who's part?.
Keymaster, RemoteMaster, RMIR?

I've been fiddling with those mouse commands looking for a pattern. I do see some columns of 4 bits that are all the same, and the final bit being a parity bit, but I can't find any pattern. Its such a few commands.

I tried to use the commands on my NUC but it doesn't show any infrared devices, at the same time, I went into the bios and its enabled and I have a choice of generic, xbox or RC6 commands in the bios.....

Posted: Sat Sep 09, 2017 8:48 pm
by The Robman
The first 8 bits are fixed, the next 5 bits are variable, the next 8 bits are fixed (at zero), the next 8 are variable, the final 8 bits are mostly fixed at zero, but for 3 buttons (colon, comma and right square bracket) there are 2 bits that might be set.

So, what you could do is, treat the first 8 bits as the 1st device code, the 8-bits of zeroes could be the 2nd device code and the last 8 bits could be the 3rd device code. You could use 2 variable bytes where the 2nd byte populates that 8-bit variable portion. 5 bits of the first variable byte can populate the 5-bit variable portion. That leaves 3 bits spare, which you can use to populate the 2 bits on the last byte that sometimes get set.

The benefit of doing all that executor logic is that you would have 2 variable bytes rather than 4, saving you 2 bytes per button. But the question is, will the executor use up more bytes than you save?

Posted: Sun Sep 10, 2017 4:51 am
by vickyg2003
Hi Rob, I already did the keyboard commands, but there were mouse commands in the samples from Harmony as well.

Here is the keyboard upgrade. It looks good to me, not sure if the timings need to be adjusted to make it work, but bumps are in the right place.
https://www.hifi-remote.com/forums/dload ... e_id=14676


No its the shorter mouse commands that are giving me fits.

Code: Select all

1	36199	Repeat:	+2700; 00001000 00011 0000 000 0000 00 0011 1100 -74400 RightClick
2	36529	Repeat:	+2700; 00001000 00101 0000 000 0000 00 0101 1010 -74400 LeftClick

3	36529	Repeat:	+2700; 00001000 01111 1111 010 0000 00 0001 0000 -10800 MouseUp	
4	36529	Repeat:	+2700; 00001000 00001 0000 000 1111 01 1001 1110 -10800 MouseLeft
5	36529	Repeat:	+2700; 00001000 10000 0000 111 1111 00 0000 1111 -11100; Mouse_L_Down
6	36529	Repeat:	+2700; 00001000 01000 1111 010 1111 01 0001 0111 -11100; Mouse_L_Up
7	36529	Repeat:	+2700; 00001000 10000 0000 101 0000 10 1000 1111 -11100; Mouse_R_Down	
8	36529	Repeat:	+2700; 00001000 01110 1111 011 0000 10 1001 0001 -11100; Mouse_R_Up
9	36529	Repeat:	+2700; 00001000 01111 0000 000 0000 10 1001 0000 -10800 MouseRight
I do see where there are 4 1111 or 0000 in a row that corresponds to a direction.

Posted: Sun Sep 10, 2017 11:44 am
by The Robman
vickyg2003 wrote:I do see where there are 4 1111 or 0000 in a row that corresponds to a direction.
Yeah, I just noticed those too. So, once you handle the 8-bit device code, you have 26 variable bits, which would require 4 variable bytes. If you can reduce it to 24 bits or less, you can use 3 variable bytes. So, if you could handle those 4 bits using 1 or 2 bits, you would be down to 23 or 24 bits.

Posted: Sun Sep 10, 2017 1:10 pm
by vickyg2003
The sad thing is, I'm a huge pack rat, and last year forced myself to clear off a shelf in my bookcase. I threw out all the books on DOS based programming, including how to program for a mouse..... It seems to me that some of those bytes are speed in the various X Y direction. If I knew the specs we could probably simplify it by making them the same speed in all directions.

Posted: Mon Sep 11, 2017 2:15 pm
by vickyg2003
Okay I am seeing some patterns finally

There are 5 bits that are comped in every frame.


00001000 01111 1111010 0000000 00 ~10000 ; UP
00001000 11110 0000110 0000000 00 00001 ; Down



Lefts
have 1111
00001000 01000 1111010 1111010 00 10111 ; Left UP
00001000 00001 0000000 1111011 00 11110 ; Left
00001000 10000 0000111 1111000 00 01111 ; Left Down

Rights have 0000
00001000 01110 1111011 0000101 00 10001 ; Right Up
00001000 01111 0000000 0000101 00 10000 ; Right
00001000 10000 0000101 0000101 00 01111 ; RightDown;

Ups have 1111s
00001000 01111 1111010 0000000 00 10000 ; UP
00001000 01000 1111010 1111010 00 10111 ; Left UP
00001000 01110 1111011 0000101 00 10001 ; Right Up

Downs have 0000s
00001000 11110 0000110 0000000 00 00001 ; Down
00001000 10000 0000111 1111000 00 01111 ; Left Down
00001000 10000 0000101 0000101 00 01111 ; RightDown;


Clicks With Mouse buttons
00001000 00011 0000000 0000000 01 11100 ; Left Click
00001000 00101 0000000 0000000 10 11010 ; Right Cick

There are 2 bits that appear to indicate which button are pressed.

Posted: Mon Sep 11, 2017 9:03 pm
by The Robman
I think the first 5 bits (counting the bits from left to right) are a checksum of the rest of the data, but I haven't spotted the formula yet. Bits 1 and 10 are the same.

Posted: Mon Sep 11, 2017 9:19 pm
by vickyg2003
I have added the Mouse Commands to my MCE zip file, so now the Keyboard and Mouse buttons as well as the regular MCE upgrades are sitting there waiting for someone to test them.

https://www.hifi-remote.com/forums/dload ... e_id=14676


I haven't seen jriker1, the OP, around lately. I PM'd him when I finished the KeyBoard commands, but he hasn't picked that up. It could be the weather,
Those hurricane's have been impacting lots of people . I hope I didn't do this for nothing.

I can't figure out why my NUC's infrared device isn't showing up, or I'd test it myself.

Posted: Tue Sep 12, 2017 8:30 am
by The Robman
vickyg2003 wrote:I haven't seen jriker1, the OP, around lately. I PM'd him when I finished the KeyBoard commands, but he hasn't picked that up. It could be the weather, those hurricane's have been impacting lots of people.
Looks like he's in the Chicago area, so I don't think it's hurricane related. I just emailed him (and copied you).

Posted: Tue Sep 12, 2017 2:18 pm
by mdavej
Amazing work Vicky, Barf and Rob. I have no MCE IR dongle anymore to test these, but I can fill in a few gaps. Here are some additional codes I found in the keycodes table below that could be added to your keyboard upgrade (OBC values in hex. I don't know what to use for byte 2 (complement?)). Nobody will probably ever use these, so it's just as well if they are not added. Just wanted to post them for completeness if it ever comes up.

http://kodi.wiki/view/Using_a_Microsoft ... _key_codes

(Not pretty, but I was too lazy to transpose the columns)

Code: Select all

Hex Function
2E - Equal
46 - Print Screen
47 - Scroll Lock
48 - Break (Ctrl-Pause)
4B - Page Up
4E - Page Down
4F - Right Arrow
50 - Left Arrow
51 - Down Arrow
52 - Up Arrow
53 - Num Lock
54 - Keypad /
55 - Keypad *
56 - Keypad -
57 - Keypad +
58 - Keypad Enter
59 - Keypad 1 End
5A - Keypad 2 Down
5B - Keypad 3 PageDn
5C - Keypad 4 Left
5D - Keypad 5
5E - Keypad 6 Right
5F - Keypad 7 Home
60 - Keypad 8 Up
61 - Keypad 9 PageUp
62 - Keypad 0 Insert
63 - Keypad . Delete
64 - Europe 2
65 - App
66 - Keyboard Power
67 - Keypad =
68 - F13
69 - F14
6A - F15
6B - F16
6C - F17
6D - F18
6E - F19
6F - F20
70 - F21
71 - F22
72 - F23
73 - F24
74 - Keyboard Execute
75 - Keyboard Help
76 - Keyboard Menu
77 - Keyboard Select
78 - Keyboard Stop
79 - Keyboard Again
7A - Keyboard Undo
7B - Keyboard Cut
7C - Keyboard Copy
7D - Keyboard Paste
7E - Keyboard Find
7F - Keyboard Mute
80 - Keyboard Volume Up
81 - Keyboard Volume Dn
82 - Caps Lock
83 - Num Lock
84 - Scroll Lock
85 - Keypad , Brazilian Keypad .
86 - Keyboard Equal Sign
87 - Keyboard Int'l 1
88 - Keyboard Int'l 2
89 - Keyboard Int'l 2
8A - Keyboard Int'l 4
8B - Keyboard Int'l 5
8C - Keyboard Int'l 6
8D - Keyboard Int'l 7
8E - Keyboard Int'l 8
8F - Keyboard Int'l 9
90 - Keyboard Lang 1
91 - Keyboard Lang 2
92 - Keyboard Lang 3
93 - Keyboard Lang 4
94 - Keyboard Lang 5
95 - Keyboard Lang 6
96 - Keyboard Lang 7
97 - Keyboard Lang 8
98 - Keyboard Alternate
99 - Erase
9A - SysReq/Attention
9B - Keyboard Cancel
9C - Keyboard Clear
9D - Keyboard Prior
9E - Keyboard Return
9F - Keyboard Separator
A0 - Keyboard Out
A1 - Keyboard Oper
A2 - Keyboard Clear/Again
A3 - Keyboard CrSel/Props
A4 - Keyboard ExSel
E0 - Left Control
E1 - Left Shift
E2 - Left Alt
E3 - Left GUI
E4 - Right Control
E5 - Right Shift
E6 - Right Alt
E7 - Right GUI

Posted: Tue Sep 12, 2017 3:16 pm
by The Robman
mdavej wrote:(Not pretty, but I was too lazy to transpose the columns)
I fixed it.

Posted: Tue Sep 12, 2017 4:49 pm
by vickyg2003
Just like the mice commands there is some sort of checksummy thingy in those codes that i don't know what they mean. But maybe some day.....

Posted: Wed Sep 13, 2017 9:25 am
by The Robman
Hey Vicky, while answering Graham's questions in your other thread, I discovered an old spreadsheet that I put together that does the conversion to binary for you, check it out...

https://www.hifi-remote.com/forums/dload ... e_id=11301

Here's a version with the MCE times loaded...

https://www.hifi-remote.com/forums/dload ... e_id=14688

Posted: Wed Sep 13, 2017 9:29 am
by The Robman
I have split the NUC conversation to here:
https://www.hifi-remote.com/forums/viewt ... p?t=100972

JR, feel free to edit the subject line to something more meaningful if you like.

Posted: Wed Sep 13, 2017 11:25 am
by vickyg2003
The Robman wrote:Hey Vicky, while answering Graham's questions in your other thread, I discovered an old spreadsheet that I put together that does the conversion to binary for you, check it out...

https://www.hifi-remote.com/forums/dload ... e_id=11301

Here's a version with the MCE times loaded...

https://www.hifi-remote.com/forums/dload ... e_id=14688
I'll take a look at this, but typically I leave this part up to someone else, as my dyslexia really makes this part unpleasantly hard.