The internet is filled with very helpful people. Almost any project you can imagine has been at least attempted by someone somewhere. These links might be useful:
This link has a great explanation of how to use a keyboard for arcade controls.
http://www.dribin.org/dave/keyboard/one_html/
This is an example of someone that has already done what I plan to
http://www.hellspark.com/dm/mame/deprecated/keyboard/
That’s the rough idea.