Problem binding inputs in MAME

Hi

Im trying to setup a Picade HAT and all works fine apart from in MAME roms. The problem is exactly the same as in this thread

I have no idea how to fix it though, please help!