Power supply compatability is always a question of correct voltage, sufficient amps available, correct size and type of power plug, correct polarity of the plug. If they all match you can use any power supply on anything else, although use of unregulated power supplies can cause problems (see below). All the Yamaha adapters I've met for the past 10 years have been regulated.
Correct volts is obviously vital, and not having enough amps available usually causes keyboard malfunction or overheated power supply. Not enough volts is also liable to cause keyboard malfunction. Too many volts will fry things so don't go there.
Always use a regulated power supply. You can get unregulated power supplies but they should only be used if the volts and amps rating is exactly the same as the original power supply and even then only if the original supply was also unregulated. The problem with unregulated supplies is that if the load when in use is not as great as the supply rating, the volts rise and could damage the keyboard.
Modern "switch mode" power supplies are regulated and also lighter than older style bricks, but tend to be more expensive.
I'm currently using a laptop power supply on my PSR3000 because they were selling them cheap at my local electronics supplier and £15 for a last-years-model generic laptop supply is rather cheaper than £50+ for the official Yamaha version. My Yamaha PSU is fine, by the way, but the offer was too good too miss and so I've got a perfect spare in my gig bag.
Back to the plot. I've just been to the Yamaha manual site and looked at the KX5 manual. Asssuming we are talking about the same KX5 (37 key remote keyboard) it seems to run on 6 AA batteries, so it's a 9 volt system, but there's no mention of a power supply and also I don't see a power supply socket! Have I got this wrong? Please advise.
_________________________
John Allcock