Replace uses of which to keyCode