I've had good success hacking IBM PS/2 keyboards.
There are exactly enough input lines on most non-usb keyboards to enable 2 joysticks with 6 buttons each. They key's that are used to make a bunctional hack end up being bizzarre, like scrl lock, F8, \ and the like.
It took me about 2 hours to decode the input matrix on the keyboard. Upon playing it, we found that I had used certain keys that do a windows function, like the alt key and the enter key, that would dump one out of most emulators.
There is a tutorial on mameworld.net that will tell you everything you need to know about how to hack a keyboard, including decoded matrixes for several keyboards.
I hacked a Saitek gamepad too, which seems to work well enough.
If you're spending money on a cabinet anyway, and don't mind spending more, then go for the encoder, because they sound so much easier. If you're scrounging for spare parts and want to build on the most restrictive budget, then a keyboard hack will serve you just fine, provided you don't need more than 2 sticks with 6 buttons each.
Bob