Just as you can add event listeners to any DOM element, you can add event listeners to the window object with <svelte:window>.
window
<svelte:window>
On line 33, add the keydown listener:
keydown
<svelte:window on:keydown={handleKeydown}/>