My wife discovered something that most ants loathe and detest. They will go to any lengths to avoid it and escape it. They will not go near it.
All you do is put a TINY amount on, in, or near any thing or area where ants are and… They're gone.
She first noticed its effect on tiny black ants in a bathroom and then with tiny pharaoh ants.
[all talcum powders deter ants, actually].
What is this magic ant repellant? CHANEL™ Body Powder.
Try a pinch on a sheet of facial tissue and put in in a plastic bag to coat the tissue lightly and evenly. You do not need much. After all, how much body powder does a tiny insect need for their tiny antibodies.
Put your infested piece on the tissue or lay the tissue on the keyboard. The ants will find their way out of any ports on the sides. Otherwise cover half of the keyboard so they can escape from the other side.
After the ants vacate the premises, the residue will keep the place void of them.
I'd love to watch. Good luck.