There is a way to install an electric keyboard onto an upright piano. Consider this an option both as being unique and as making use of what may otherwise be an unrepairable instrument with an attractive or antique exterior. The upper interior of the piano, including the soundboard and strings, can remain intact for aesthetic reasons or also may be removed for further "reclaimed" uses.
Measure the intended keyboard and check to see if it will fit. The height of the keyboard is not important as it will sit on the ledge where the keys are currently resting. The depth of the keyboard should not extend past the front lip of the piano, and the width of the keyboard should be less than 88 keys. Therefore, it is not practical to replace the keys of the piano with a full size electronic keyboard as it will not fit.
Remove the upright piano keys. Use a chalk line stretched out atop the back end of the keys from left to right to create a cutting mark on them. It should be flush against the end of the fingerboard. This mark is needed because the keys must be depressed in order to be cut precisely.
Press the keys down and use a compact skill saw to cut along the chalk line for the length of the keyboard. Each key should be cut evenly so that the part that is visible on a typical piano can then easily be removed. After all the keys are gone, what remains is the base of the fingerboard and supports.
Place the keyboard in the frame and use the level to determine where support is needed. Fill in empty areas with scrap wood or wooden shims until the keyboard is sturdily in place.
Run the power chord through the remaining area above and behind the keyboard to the bottom of the piano where it can then be plugged into a nearby outlet.
For a more permanent solution, try using liquid nails to secure the keyboard into place.
Be extremely careful with the saw blades when cutting the keyboard. Apart from the obvious safety factors, if a piano string is accidentally cracked or cut, it can snap and cause severe damage to the person making the cut, anyone who is nearby or to the casing of the piano.