This basic AutoHotKey script automatically switches ALT and WIN (or CMD) keys when a particular device (whose name is hard-coded in the script) is connected.
It requires the AHKID library ( see Github page ). To retrieve the device name, see example_1.ahk
.