Move the key-down clearing into a separate function; call it when initialising cgame.