Add separate key buffer for handling shortcuts

This way, the key state remains 1 while a key is pressed, which makes things like panning with arrow keys work properly. (No longer have to rely on key repeat.)