Proximity sensor for keyboard

Hi is there a proximity sensor that can measure distance of small objects, like keys, perpendicular to its location?
If possible to also have a decent refresh rate and multi object detection.

I would need to know more to provide a guess.

By "keys" do you mean keyboard keys, piano keys, lock keys, encryption keys, ...???

What distance range do you need? What precision? What refresh rate? What budget?

What materials? Must they be metallic, or must any substance be detected?

@johnwasser sorry, I meant a PC keyboard which has a sensor on the left and right side, and senses the key pressed by distance when it lowers into FOV. I'd be happy with range of ~30 cm, precision ~1mm, refresh rate 60Hz or more, 120Hz if possible, around 50$.

@anon57585045 it would be plastic, sorry.

Does the system have to differentiate "keys", identify a particular key from another one?

$50 for a prototype, or $50 for one of 10,100,1000,10,000... ?

Would something like this do?

@anon57585045, it'd be helpful if it could detect the mm certain key has lowered from its initial position, so distance x,y and height of the key in FOV. I was thinking about $50 for DIY model.

@johnwasser I'd like to avoid classic electronic switches, instead have the optical detection of keypress.

Just so we're on the same page, are we talking about conventional pushbutton type keys? You can probably find optically detected pushbutton assemblies, commercially made. They have many application such as use in explosion deterrent environments. There are also numerous IR prox modules, with a built in IR LED and photodetector. Just peruse an online supplier catalog and you should find quite a few.

But an X,Y,Z 3 dimensional location is really asking for a lot. I'm going to attempt to stop wasted speculation here and request that you fully explain and specify what this thing is and what its operating parameters are.

For example, "FOV" by itself says nothing. What is the FOV? How big is the volume? Is it shielded from incident light? If not to what extent... and so on. Please explain all such things that we would need to know to give a meaningful answer.

I'd like to build a PC keyboard without a PCB for keys, just one PCB on each side for sensors. Use sensors for detecting keypresses (as the key pressed lowers into FOV).

I thin that if I were going to do something like this I would use one LCR/LED pair per row (5 rows) and a separate set of 15 to 30 optical sensors to detect which 'column' had a key depressed. The LCR analog reading would indicate which row had a key down and by how much. Combined with the column sensors you could determine that a single key was down and how far.

Yeah, still sketchy on details. What are the keys like? How big is the FOV? Some other things...

How about this one? VL53L1CXV0FY/1 STMicroelectronics | Mouser Europe? It says that it's multi object and multi-zone capable.

You are repeatedly ignoring requests for information.

Sorry, but I did say that the keys are plastic, and that it's a regular PC keyboard clone, just without PCB for single keys, and without the main PCB for keys. But keys can be of any shape, since I'd be printing them. FOV would have to be such that it detects keypresses from left of the keyboard to the middle(~15cm), and same for the right side. So, I guess it would either have to be a pretty wide angle for the first key column or I'd have to add multiple sensors.

Oh, you want one sensor to laterally sense an entire row of keys... well that is really a tall challenge for any distance sensor. To make it more difficult, at the furthest extreme the FOV still has to be contained in the row space and not impinge on the adjacent row.

I still have the feeling I'm guessing about your configuration because we're using only words here. Can you post a simple drawing?

33303b71-9726-402f-9834-875397dcbfb4

"window dressing". You already described a key element that is depressed. The video adds very little to that, other than showing a row. There are no sensors, just bare blocks, and there is only one row. Please just make a simple but complete pencil drawing, as if you were making a patent application and needed to show exactly what you are doing.

Don't leave out the sensor details, though... that is the devil in the detail in this case.