Factor out Windows-specific key events