A USB extension cable will work perfectly fine. So long as its under about 15 foot, any further and it will start to drop signal (from what I'm told at least).
I'm curious to whoever told you wireless was bad for gaming though, any newer keyboard, like the logitech K340 (not recommended for gaming, but great for just typing), can extend well over 30 foot and still have excellent signal - so long as you dont have anything to interrupt it such as a microwave. I personally game with a totally wireless setup LX710 (not as large of a range as the K340 but still nice) and a G7 (which can go 30 foot easy!).
I'm just ranting in the wind I suppose. A USB extension is going to be tons cheaper (depending on where you purchase it) so you should just go with that. But if anyone says wireless is bad, they're living in the old days.