Making pie menu hotkeys into toggles / speed

A lot of the time I don’t really want the pie menu to change anything. While I could just make the selection, something FASTER (“8” is a long reach!) would be if the same key that invoked the pie menu also dismissed it.

How difficult would that be to code? Or can it be done otherwise?