After some further experiments with putting ITR8307 under the keys, I'm noticing some considerable crosstalk between the keys (pressing keys to the left & right of the sensor impacts the readings).
I'm not 100% conviced that it won't work reasonably well even with this amount of crosstalk, because it still might...
However, I'm slowly starting to suspect that any method that involves optical sensors simply won't do because of just how close the keys for my piano are to each other.
The black key of my piano itself is only 7.5mm wide (!!!), and the width of the key above the sensor for white keys can be as narrow as 11mm. (this is 132mm octave action).
Perhaps if the ITR8307 IR LED is shone less brightly with a higher value resistor, the issue would be less pronounced, or maybe some plate could be machined that are put on top of the PCB that would block some the light coming from the sides, however those walls can only be 2mm-3mm high at best, since that's the distance to the sensor once key is pressed down...
It might be the case that I do have to use the slot-through type optical sensors in the end, since those have no issues with crosstalk at all (and avoids analog domain altogether, which is a huge win in my book), but will require to machine an slot-through key element per every piano key.
There was some other member of this forum who was making his own narrow key action (probably not as narrow as mine) and he had hall-effect sensors (which probably also have cross-talk issues?), i wonder if those are worth even trying...