Is it possible to make the object change color when touching another object?
I found a way to implement this. I just need to bind the driver to the nodes.
It's not an easy way, but it works great!

Here, the material nodes (each key has its own, independent) are based on a variable that is controlled by the driver, which, in turn, looks at the local rotations of the key.

The difficulty is precisely in the quantity: 88 keys with 88 materials and the same number of drivers.

each key, just in case, is tied to empty, which are collected together and attached to the main empty.


The recipe is as follows:

create the first material with nodes according to the example above
RMB on value -&gt; add driver &quot;guide&quot;



You configure the driver by example. Here the &quot;key name&quot; will change from material to material (the name of the object-synthesizer key is implied). 

you transfer the key to the pressed state and turn the ColorRamp until it is white at rest, and green when it is pressed.


An important point:
before all operations, you need to reset the rotation and scale of each key to normal, via Ctrl + A .

You duplicate the key, put it next to it, duplicate the material, rewrite the name of the key in the edited driver and repeat until you assemble the keyboard.


Then link through empties and you can move the synthesizer by pulling the main one
Here it is also important that the animation is exactly the rotation of the keys according to their local coordinates.