You could try something like this...
#Persistent
#IfWinActive
Numpad4::#^{Left}
Numpad9::#^{Right}
This just does a basic key reassignment.
With the script running, you can also go to the Open option via the Tray Icon and look at the Key History to see what keys are registered and/or sent (if you want to look at remapping other items.
If you need to do more than a simple key reassignment you can code it as a routine using SendInput
and then do a Return
at the end.
#Persistent
#IfWinActive
Numpad4::#^{Left}
Numpad9::
SendInput, #^{Right} ; does the same thing as a direct reassignment
MsgBox, Add other code as needed for functionality or debugging
Return
Also, a separate but somewhat related post on Win10 virtual desktops here: Windows virtual desktops. Cycle back to first desktop at end