What's the problem that the extra assignment is for? Should there be a separate issue? And might there be a problem with passing a keyCode where a charCode is expected?