I want to know how to stop a running node when I type a certain key

Hi @anon75023769 , welcome to the forums.
You can use a timer instead of the delay node, which then can be cancelled.

K key triggers the ‘delay’ made by that timer.
L key allows to cancel out that timer, so the Event (your quit of the game) is not run