no easy way springs to mind, you can control windows firewall via the command line netsh command with the advfirewall option for example
netsh advfirewall firewall add rule name="my program" dir=in action=deny program="C:\Program Files\myprogram.exe" enable=yes
would create a rule called my program denying incoming traffic to the program "C:\Program Files\myprogram.exe". You could create a batch file with this command and bind it to the mouse button with autohotkeys (http://www.autohotkey.com/)
one batch file to turn off access bound to pressing down the button, another batch file to turn it back on bound to releasing it. Can't see why it wouldn't work, but i've never tried it