Nice idea, we also thought about making something about the Esc key.
One thing that made it harder until I understood how it works is the direction of the sword is the last direction you moved to.
Yes, I am planning on making it attack in the direction of the cursor instead of movement vector, I should've just hide it to not mislead the player.