I'm not 100% sure on this as I haven't done it, but here's what I think: Setup MAME to use joystick inputs only, (& enable joystick of course), and I think that will work (ie the keypresses will effectively still be there, but ignored by MAME). I am assuming that with JoyToKey running the 'real' joystick inputs are still read (you could check in Control Panel > Game Controllers, Test screen).