Some keys supposedly have an accelerometer and will stop emitting if the are not moving, but I really have no idea if this is mainstream or a legend. Myself, I have never seen any key that would stop emitting.
It is rather hilarious how basic threat modeling can basically shore this up as way more impossible to do fool proof than you'd think. You may think "put biometrics/camera" on car so that it can see who is trying to open it. Suddenly valets and kids can't open cars for you. Turn off when key is lost? See plenty of takes on that in this conversation.
[0] https://www.ford.co.uk/support/how-tos/keys-and-locks/door-l...