Just open up notepad like normal. When you press any button assigned to a normal key (not shift, cntrl, alt, etcetera) then you will have that letter displayed in notepad.
All of player 2's MAME defaults are letter keys, so it's easy to test player 2 by going into notepad and playing with your controls there.