First, the Tronsmart Prometheus (or clone or g18ref or whatever) normally comes with a 38khz Vishay IR receiver (TSOP34838 marked VS838, fairly common cheap sensor ~$1.50). The Amlogic SOC has a hardware NEC Remote protocol decoder. The Amlogic Remote software can also support RC5 and RC6 remote protocols in software, but I have not figured that out yet. So you need a remote with NEC remote protocol support. More on this in a minute.
In my case, I use a Comcast/Xfinity Remote control, which is really a UEI JP1.x Universal Remote Control. It has a ton of different device profiles, and can add and remove buttons, add secondary functions, or even macros, for a fully customized layout, manually. If you use the JP1.x port and some software, you can add so much more to it. Hifi-remote.com and getzweb.net/jp1 are great sources of information for them.
The reason I mention that is because I used a random NEC device code to program my Prometheus. It can be any with the NEC protocol, but try to find one which has most of the buttons pre-programmed. Mine was cable box code 899 added to the Cable button. Each device code can send up to 255 scan codes. (0x00 - 0xff).
There are four files/programs you will use:
* dmesg : Where you will get your information * Remotecfg : Used to load new Remote.conf files and checking for errors in them * /system/etc/Remote.conf : File which maps your remote scan codes to linux key codes * /system/usr/keylayout/Vendor_0001_Product_0001.kl : File which turns Linux Key codes to Android Key codes for the Amlogic IR device
If you aim your NEC control at the Prometheus and press a few buttons, run "busybox dmesg", you should see something similar to:
[ 5094.377000] Wrong custom code is 0x[B][COLOR=#0000FF]XX[/COLOR][COLOR=#FF0000]YY[/COLOR][COLOR=#008000]ZZZZ[/COLOR][/B] [ 5095.872000] Wrong custom code is 0xef109c21 [ 5097.694000] Wrong custom code is 0xee119c21
Before we edit the remote.conf file, we can pull all the scancodes from here.
1: Run "dmesg -c" to read then clear the dmesg log.
2: Press every button on your remote Once (Keep track of the order)
3: Run "dmesg | grep "code is 0x" | rev | cut -c 5-6 -c 9-10 | rev | uniq >> /IRDump.log"
This will create /IRDump.log with a list of scan codes, one for each button you pressed, in 0xYY format. These will be used in your Remote.conf file. They should match the order you pressed them in, if not, you will get mixed up buttons later.
Next is the Remote.conf file. The default is in (/system)/etc/Remote.conf. This is where the Android Init file for the Prometheus loads it from. Since System is mounted Read Only at start, you will need to be Root. Run "mount -o remount,rw /system" then make a backup just in case "cp /etc/Remote.conf /etc/Remote.conf.bk". Now we can edit the file. The first edit is the factorycode. You should change it like above (For me "factorycode = 0x9c210001")
The second is everything between key_begin and key_end. Delete it, and copy your IRDump.log into it. Now comes the annoying part. Mapping each line to a keycode. The format will be scancode, space, keycode (in 0xYY hex, or decimal with no leading zero). It can only be space, not a tab or anything else or Remotecfg will segfault. The default keycodes for the Amlogic IR Device are in /system/usr/Vendor_0001_Product_0001.kl. Format is "key Linux-Keycode Android-Keycode". The LinuxKeycode is what will be produced when your scancode is seen. Then the linux subsystem will send the AndroidKey to the Android system. (you might see FUNCTION, WAKE, WAKE_DROPPED, those parts can be left) The Keycode is fairly arbitrary, but must match between Remote.conf and Vendor_0001_Product_0001.kl
Remote.conf | Vendor_0001_Product_0001.kl 0xff 242 ;Help | key 242 APPSETTING # SettingsMBox
Notes. Multiple scancodes in the remote.conf can produce the same keycode. So the "Last" and "Exit" buttons can both produce keycode 158 which is the Android Back key. And multiple keycodes in the .kl can produce the same Android codes. But the same scancode can only produce the last keycode listed. And the same keycode will only produce the last android code listed (if it passes validation at all).
Remote.conf 0xff 241 ;Help 0xff 242 ;Help Vendor_0001_Product_0001.kl key 242 APPSETTING # SettingsMBox key 242 APPCAMERA # SCREENSHOT

You can edit the Vendor_0001_Product_0001.kl file as well, but the only way to test it is reboot. If the KeylayoutMap library sees an error, it won't load it ("dmesg | grep KeylayoutMap" to check for errors). I pulled every valid Android code from the prometheus framework to the included AMLogic_Keycodes.txt to avoid those errors (just remove the "KEYCODE_" part). Not all will do something, depends on the app really.
Remote.conf can be tested right away. Run "remotecfg /path/to/remote.conf" and you will see it read everything, and you can start pressing buttons.
Included is my remote.conf and modified Vendor_0001_Product_0001.kl with comments and expanded settings, an annotated Amlogic remote setup guide (google translate + adjustments) and the AMLogic_Keycodes.txt.
Useful notes. The POWER and ENDCALL android keycodes will turn off the Prometheus, but since power is cut to the usb hub or usb system or the 5v regulating ic section, and the IR stops responding afaik, the only way to turn it back on is flipping the power switch

The dpad directions and volume keys, Home, Menu, Back, Search (or Assist for direct to google search) are all important. As is Enter and Escape, which act differently from DPAD_Center and Back btw.
UPDATE: Special Function Mouse settings
Just figured out the mouse feature. Adding an IRcode to "fn_key_scancode" will make it work like a toggle for the mouse. The rest act like the directions, left mouse click/finger press (with long press support), and the mouse forward/back buttons (Used to scroll up or down a screen!). These can be unique buttons, or they can be the same buttons, using the same method to find the scancodes as before. My setup turns 2, 4, 6, 8 into the mouse directions, 5 as the mouse click. The function key has to be pressed once to turn it on, again to turn it off. This should go between the factory code and the key_begin code.
fn_key_scancode = 0x78 left_key_scancode = 0x16 right_key_scancode = 0x17 up_key_scancode = 0x13 down_key_scancode = 0x0d ok_key_scancode = 0x14 pageup_key_scancode = 0x18 pagedown_key_scancode = 0x19
pro_remote.zip
Comment