Temporarily enable Osnap dialog box


Would it be possible to create a python script that enables and displays the Osnaps dialog box temporarily by holding down a button (for example S)? When the same button is released, the dialog box should disappear. It would also be great if the dialog box showed up at the mouse pointer location, enabling me to quickly toggle Osnaps on/off.

Press and hold ‘S’ button --> Show Osnap dialog box at mouse pointer location.
Toggle Osnaps on/off from Osnaps dialog box.
Release ‘S’ button --> Hide Osnap dialog box.

Holding ‘Alt’ key already does this purpose (temporary enable/disable Osnap).

Thank you, but what i really meant was to create a script/code that display the Osnaps dialog box as a popup toolbar, under the cursor, giving me the option to enable/disable between the different Osnaps. This Osnaps popup box should only be visible when i am pressing and holding down for example ‘S’, and disappear when the button is released.

This is the Osnaps dialog box i am referring to:

Hi @AMG,

The best you can do is script the _-ShowOsnap command.

– Dale