Registe key event on Mac & Windows.