If I remind correctly, MAME natively supports DirectInput 8, and that's what you get with the keyboard provider option. Your app propably requires DirectInput 7, that might be the issue. You can still get that but you need to compile a special build, activating a flag before compiling. I can't provide the details, but it shouldn't be hard to google for the instructions.