Honestly, that isn't easy, for multiple reasons. One, trying to find the buttons that actually work with your TV (and work correctly) can be very time consuming.
Two, Pierogi really isn't set up to dynamically switch buttons around, at least not yet. (The "macro" mechanism might be used to do that, but the macros are broken right now; I just haven't been able to get back to fixing them yet.)
But, if you can tell me the model number for your TV, I may be able to find an accurate config file for it and add that into Pierogi, which is probably the easiest solution of all.