Revert "Revert "Fix build errors for MS-Windows after KeyEvent class pimpling patch.""