I just did this for openelec.
Need to create a new file on the openelec system here:
/storage/.xbmc/userdata/keymaps/keymap.xml
And add the following
<keymap>
<global>
<keyboard>
<s>XBMC.Shutdown</s>
</keyboard>
</global>
</keymap>
Where <s></s> is your programmed key to perform shutdown. In this case i used "s".
I also set shutdown to suspend in XBMC so it can powered back on via the remote.
I was unsure what key is set when using shutdown from the FLIRC GUI using the XBMC controller, so i just mapped the shutdown to "s" using the keyboard controller in the GUI.