This didn't stop being a problem for me until I made a long term effort to only allow my keys to be in my hand, in the ignition of my car, or in my pocket. Not my coat or jacket pocket either. My pants pocket. I may not always have my jacket, but I always take my pants. Opening a door and leaving them in the lock is also not allowed. I used to do that and then leave them there all night long. No matter how inconvenient it may be at that moment, this rule is never to be broken.
Keys are in the hand, ignition, or pocket only!
I never let go of them unless they are going in the ignition or my pocket.
It was hard at first and I continued to lose them for a while. But I kept at it and because I did this the pattern is now habit and my keys haven't been lost in years.