Apple has been granted a patent (number 9,154,677) by the U.S. Patent & Trademark office for a "camera accessory for angled camera viewing." If it ever comes to fruition — and Apple has lots of patented ideas that never become reality — future Macs and iOS devices could have 3D cameras and projected virtual keyboards.
The patent involves a removable camera accessory with its own stand (or other support structure) that would be connected magnetically. Actually, the camera accessory has two cameras: one front-facing and one rear-facing.
The camera accessory would be used to capture data from both cameras simultaneously to create 3D images. It could also be used to project a virtual keyboard on, for example, a desktop, allowing typing without the need for a physical keyboard or an onscreen keyboard on an iPad or iPhone.