use a counter to know how long ago that key was released, if the player press it again before a limit time, it is a double press.
var timer = 0
var timerLimit = 0.3(seconds)
on D key released set timer to timerLimit.
every tick > subtract dt(deltatime) from timer.
on D pressed if timer > 0 = seconds press (within limit)