fix KeyCode back compatible
Merge pull request #7108 from minggo/v3

fix compiling error
Merge pull request #7003 from andyque/back_compatible_fix

fix KeyCode back compatible