Projecting an image of the keyboard? Probably a laser and a diffractive element
Then a camera detecting if anything (ie a finger) is blocking a particular key
Not so simple though, because when you press a key on the top of the keyboard, your hand blocks a major section of all the keys below. So it has to distinguish which key is actually being pressed.
From a consumer standpoint, a very stupid product because now I no longer have a tactile feel of a key being pressed, nor do I have the indents as a reference (on the F and J keys) for my fingers so I can type without looking. Nor do I want yet another device with more cables and a power outlet.