fix KeyCode back compatible
Merge pull request #7003 from andyque/back_compatible_fix

fix KeyCode back compatible