Ignore event spams of keys we already have

This PR fixes a bug where keeping a key down for a while causes the DAG not to be traverses correctly.
Wouldn't it result in less code if you'd do a `if (buf->code == code) { return ... }` here and remove the `continue` therefor?