diff --git a/SavedKeyLists.ini b/SavedKeyLists.ini index 3a597d8..4985fb6 100644 Binary files a/SavedKeyLists.ini and b/SavedKeyLists.ini differ diff --git a/mouse2joystick_Custom_CEMU.ahk b/mouse2joystick_Custom_CEMU.ahk index 40e959c..c725b63 100644 --- a/mouse2joystick_Custom_CEMU.ahk +++ b/mouse2joystick_Custom_CEMU.ahk @@ -334,22 +334,24 @@ controllerSwitch: SetTimer,mouseTojoystick,%freq% } - Else { ; Shutting down controller - setStick(0,0) ; Stick in equilibrium. - setStick(0,0, True) - IF (useAltMouseMethod) { - LockMouseToWindow(False) - md.Stop() - } - Else - SetTimer,mouseTojoystick,Off - - IF (hideCursor) - show_Mouse() ; No need to show cursor if not hidden. - ;DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, UInt, OrigMouseSpeed, UInt, 0) ; Restore the original speed. - Gui, Controller:Hide - - } +Else { ; Shutting down controller + setStick(0,0) ; Stick in equilibrium. + setStick(0,0, True) + ; Explicitly move the cursor to the center of the screen + MouseMove, % A_ScreenWidth / 2, % A_ScreenHeight / 2 + IF (useAltMouseMethod) { + LockMouseToWindow(False) + md.Stop() + } + Else + SetTimer, mouseTojoystick, Off + + IF (hideCursor) + show_Mouse() ; No need to show cursor if not hidden. + ;DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, UInt, OrigMouseSpeed, UInt, 0) ; Restore the original speed. + Gui, Controller: Hide +} + toggle:=!toggle Return diff --git a/settings.ini b/settings.ini index 20f60e3..470b5da 100644 Binary files a/settings.ini and b/settings.ini differ