Double tap "Run"

Hey guys I’m trying to make a code for my character to run when tapping the “W” buttom but I’m having some trouble with that.
Any help would be very appreciated ^^

You will have to post your .blend files or at least your current script for anybody to provide meaningful help on this.