Change the type of keyCodeFor to int, to fix the warnings.