change the implementation of isKeyDown