Something doesn't add up. When using headphones, the sound of electric piano keys shouldn't be noticeable to neighbors outside a closed window. Unless they're literally a few foot away with both your window and theirs lining up and both wide open, it would take intentional listening to even notice.
Unless you're mashing the keys hard enough to injure yourself, sound is leaking out somehow or your neighbors have it in for you and become enraged at the slightest reminder of your existence.
-Type of housing?
-Distance to neighbors, especially the one(s) complaining?
-Type of window?
-Interior wall material?
-Exterior wall material?