hi virtex,
I spent an hour last night remapping my remote as i had a similar experience to you LibreELEC.
troggy's explanation is good, but thought i would add what worked for me.
I couldnt find an official linux keymap explanation, but used another remote.conf to get the codes.
Quick Summary:
1. I found my factory code and googled that, that gave me a start remote.conf but you already seem to be there.
2. I modified my remote.conf to set the debug_enable = 1, either edit in-situ with vi or copy to the /storage/.config directory.
3. Make that live by typing /usr/lib/libreelec/remote-config
i used this as a reference - IR CODE | KEY ID | COMMENT
0x00 116#power
0x0c 113#mute
0x01 66#media
0x05 67#tv
0x09 68#web
0x0d 69#app
0x02 114#vol-
0x06 122#prv
0x0a 123#next
0x0e 115#vol+
0x03 102#home
0x0f 1#return
0x07 103#up
0x10 105#left
0x11 97#ok
0x12 106#right
0x15 119#play_pause
0x16 128#stop
0x44 108#down
0x40 139#menu
# 0x4c 53#mouse
0x41 2#1
0x45 3#2
0x4d 4#3
0x42 5#4
0x46 6#5
0x4e 7#6
0x43 8#7
0x47 9#8
0x4f 10#9
0x48 64#caplock
0x49 11#0
0x4a 14#del
==
4. I then cycled through my remote buttons and using dmesg to see what the code was one at a time and then edited the remote.conf second column to match what i wanted matching the press ircode. If one didnt exist then i added it.
eg: 0x26 was returned as the press ircode (or scan code) for pressing UP, i then edited/created a line that said 0x26 103 ;UP eg: remote_id from dmesg, key id from above, ;comment
make sure you dont double up, but i think it takes the first or last, also add to your repeat key section at the bottom.
5. You can then test by putting the file into .config and running /usr/lib/libreelec/remote-config
worked a charm. this will give you a base setup. Then you can use the kodi keymap tool to just change buttons that give you windows and functions outside the list above eg: change audio, i dont think you would add all the functions.
cheers