Lately you can find a lot of music brands for different sustain pedals. Some will seem familiar: Yamaha, Casio, M-Audio, Roland, On Stage... But the question which one will work out for me?
I have two keyboards, a Casio CTK4200, and an iRig Keys Midi Controller, for the Casio there is no brainer, the best way is that you get a Casio sustain pedal, the most common is the Casio SP20, there is not a switch, but it will definitely work with you Casio.
The same of you have a Yamaha keyboard, the best will be the Yamaha FC4 or the Yamaha FC5, this last one it's in a square shape.
If you have another brand of keyboard or midi controller like a Korg, M-Audio, Roland, IK Multimedia's iRig Keys, or another brand, probably you will need a sustain pedal with a polarity switch, this because a sustain pedal will not always be compatible, only if it is as the same brand as the keyboard, otherwise, you will need the polarity switch. For example, for my iRig Keys Midi Controller, I was using an On Stage Sustain Pedal, square shape with a polarity switch, it worked for a couple of months, but doesn't work anymore, these square shape pedals are useless, they're pretty cheap, made with cheap plastic, and there are not very useful, I changed the polarity switch a bunch of times, and still doesn't work. The best pedals are the long ones. Now for my iRig Keys I have an M-Audio SP2, the M-Audio SP1 it's in square shape, honestly I don't know if it would be any good, so far the M-Audio SP1 (long shape) it's really good! These long ones are very steady, they don't move, but they're a little bit heavy, so maybe that's why people like the square shape pedals, they're lighter and easy to carry around, but like I said, they're not the best in quality.
So the best is that read first about which pedal you would need for your keyboard, and read the reviews to see if it worth it.