A few things.
In general, if at all possible, if the house will not sell, and if you can afford to keep paying the mortgage, then try and keep the house.
If your financial situation is likely to improve, then, if you stick it out, you may ultimately be able to get the mortgage in your own name.
If that happens, you would be trying to reach agreement with your Ex on her "share" ( plus or minus) that you were acquiring. If that failed, you would issue Court proceedings to "partition" the property. And if you then had a mortgage, you could take over the property. With allowances being made for all your additional payments.
Alternatively, sue her for her share of the mortgage. Although, she is likely to threaten to move back in or similar.
Handing back the keys is very much a last resort situation.
mf