I have the same problem. Last week I was given a replacement keypad by Apple and it worked for 5 days with its original batteries. Yesterday, all keys stopped working except arrow keys (I can still play Pac the Man)
I bought a cheap $9.90 keyboard made in China at Target the same day I brought my keypad back to Apple, as backup.
That is what I am now using successfully. How odd is that? It uses 3
AAA batteries.
Apple have since designed a new wireless keyboard with recharger inside instead of battery power.
I think they know something about this wireless keypad less than 1 year old that I purchased with my Yosemite imac retina for a lot of money.
This has something to do with blue tooth connectivity. My foreign board is all plastic, not metallic.