According to the article, they use magnets to keep them in place.
That's correct. Rare earth magnets with double sided tape keep the keyboard in place. The mouse pad is magnetic and the edges are metallic to attract a magnet attached to the mouse which anchors it and keeps it from falling. Instead, I use a trackpad which I find more comfortable.
I suppose a mounted track ball could also work for some.