Moved isKeyPressed calls to key handler