[Fix] workaround osx 10.6 lost first keypress problem
Merge pull request #3039 from ulion/osx_fix_firstkeypresslost_on_10_6

[Fix] workaround osx 10.6 lost first keypress problem, fix #14525