My eight-year-old son is left-handed and I am right-handed. I wish to be able to quickly and easily switch primary and secondary mouse buttons from the command line. We use Windows 10. I found this(link is external), which provides c and C#* solutions. I found this(link is external) which provides a solution which does require rebooting, and also provides a link to the Stack Overflow answer. However, it seems to me that this should be possible to do without resorting to a compiled language. I would be happy with a solution using PowerShell, Python, Perl, a nircmd(link is external) utility, etc., but I'd rather not resort to a compiled language.
Thank you for your help.
- FYI if you're interested: the language name apparently uses the "#" (U+0023 # NUMBER SIGN) character, not the "♯" (U+266F ♯ MUSIC SHARP SIGN) character, even though its name is pronounced C Sharp. cf. https://en.wikipedia.org/wiki/C_Sharp_(programming_language)#Name(link is external).
Edit: Changed question to add "...or by using a hotkey...", since I ultimately wanted to do this with an Autohotkey hotkey; it turns out that Autohotkey can do the swap itself. I was assuming that the answer would be e.g. a Powershell script, which I would invoke by using an Autohotkey hotkey. See the accepted answer.