Centralize WM_KEYDOWN/WM_KEYUP handling