They have magnet stickers you attach to the back of any keyboard (or mouse) and it'll work. My keyboard is kinda heavy so it needed like 10 magnets attached to it, but it's completely stable.
That said, for lying down, you really want a trackball mouse (the alternative is to dock the mouse when not in use, which is OK if you mostly use the keyboard for everything).