Method for detecting the intention of a user to lock or unlock a motor-vehicle door with a detection device (D') integrated into a handle, the device being equipped beforehand with: • a coil, • a movable electrode a first face of which is oriented toward the handle, and a second face of which is located facing the coil, said movable electrode being able to move from a rest position, located in proximity to the handle, to a final position, located in proximity to the coil, under the effect of a contact of the user on the handle, • a capacitor connected to ground, the movable electrode, the coil and the capacitor being connected together in order to form a resonant circuit a resonant frequency of which varies as a function of a variation in the capacitance of the movable electrode, and of the position of the movable electrode, said resonant frequency decreasing when the user approaches the handle and increasing when the user grips the handle and the electrode moves to the final position, • means for oscillating the frequency of said resonant circuit and means (M1') for measuring a resonant frequency of said resonant circuit, • said method comprising: • continuously measuring the resonant frequency of said detection device (D') and successively comparing said measured resonant frequency to a first threshold representative of the approach of the user and to a second threshold, higher than the first threshold, representative of the contact of the user, the intention to lock or unlock the door being validated only if: • the value of the measured resonant frequency is firstly lower than a first threshold, at a first measured time, then higher than the second threshold, at a second measured time, and • a duration (Δt) between the second time and the first time is shorter than a preset duration (Δt ref). • a coil, • a movable electrode a first face of which is oriented toward the handle, and a second face of which is located facing the coil, said movable electrode being able to move from a rest position, located in proximity to the handle, to a final position, located in proximity to the coil, under the effect of a contact of the user on the handle, • a capacitor connected to ground, the movable electrode, the coil and the capacitor being connected together in order to form a resonant circuit a resonant frequency of which varies as a function of a variation in the capacitance of the movable electrode, and of the position of the movable electrode, said resonant frequency decreasing when the user approaches the handle and increasing when the user grips the handle and the electrode moves to the final position, • means for oscillating the frequency of said resonant circuit and means (M1') for measuring a resonant frequency of said resonant circuit, • said method comprising: • continuously measuring the resonant frequency of said detection device (D') and successively comparing said measured resonant frequency to a first threshold representative of the approach of the user and to a second threshold, higher than the first threshold, representative of the contact of the user, the intention to lock or unlock the door being validated only if: • the value of the measured resonant frequency is firstly lower than a first threshold, at a first measured time, then higher than the second threshold, at a second measured time, and • a duration (Δt) between the second time and the first time is shorter than a preset duration (Δt ref). • continuously measuring the resonant frequency of said detection device (D') and successively comparing said measured resonant frequency to a first threshold representative of the approach of the user and to a second threshold, higher than the first threshold, representative of the contact of the user, the intention to lock or unlock the door being validated only if: • the value of the measured resonant frequency is firstly lower than a first threshold, at a first measured time, then higher than the second threshold, at a second measured time, and • a duration (Δt) between the second time and the first time is shorter than a preset duration (Δt ref). • the value of the measured resonant frequency is firstly lower than a first threshold, at a first measured time, then higher than the second threshold, at a second measured time, and • a duration (Δt) between the second time and the first time is shorter than a preset duration (Δt ref).