Question: Get sensors from other objects?

Hi, is it possible to get sensors from objects that are connected to the controller but they’re not from the same object as the controller, in python? For instance if you have a keyboard sensor on one object and a collision sensor on another object, and connect them to the same python controller, is there a way to get both sensors? Every time I tried the normal way of let’s say key = cont.sensors[‘key’] if ‘key’ is from a different, I get an error saying what it would say if the sensor didn’t exist. I can’t remember what it is sorry.

[Edit] Apparently it works now… Sorry to bother again.

Sure, they are all in the sensor list of the controller:

controller.sensors

Just put a print() around this attribute and you see all sensors.

These are the sensors connected with the controller.

(Be aware the build-in search (sensors[sensor-name]) fails when you have sensors with the same name, as it will return just one of them)