How can I play a widget's animation through a key press?

From the widget variable drag out a wire and search for “play animation”. Once you have that node go back to the widget variable and drag a second wire out and search for whatever you named your animation. Now connect the animation variable to the play animation node and it should create the link.