From what you have written about the facts concerning the taking of your car keys, what the police officer did was legal under the laws of your and many states. It is illegal in many states to leave keys in a vehicle's ignition when the car is unattended.The police officer obviously saw the keys in the ignition in your car while it was unattended by anyone, entered it and took the keys to secure it and prevent anyone from taking it. There was no need for the issuance of a search warrant because there was the possibility of an imminent danger to society that some person not authorized to take your vehicle would do so.