For OP just for an example:
One time I was doing something with the car, had my key fob in my pants pocket, leaned in the open drivers door, pressed the brake with my left hand and the start button with my right. It would not start, on the dash it said something about the key not being present. The fob was far enough outside the car for it not to start. I moved closer and it worked.