Adding a Preference Toggle To The Toolbar or Context Menu

I have been experimenting with the single click option. For those of us who know, it is not really a good option for typical constant use. It does have its times when it would be very helpful though. Because of this I was trying to find a way to add a button to toggle this option on and off very quickly only when I need it. Basically check and uncheck the box in preferences by using a toolbar button. I may even add it to the context menu after the fact.

Here is the preference:

Settings>Preferences>File Displays>Mouse>Single click to open an item.....

I figured it had something to do with the "Command Editor", the "prefs" command and the "@toggle" argument but I can't figure it out? Can anyone help?

Also, for future reference, I am trying to figure out how I would know the code name for each preference. There are so many options, how does one know what to use to reference a specific preference? Is there a dedicated list somewhere?

Thanks in advance!

Not all Preferences settings can be toggled via commands. Those that can are usually handled by the Set command, e.g. Set GRIDLINESV=toggle will toggle vertical grid lines on and off.

I don't think there is a command to toggle the single-click option, at least currently.