Button That Toggles A Qualifier Key

Hello,

Is it possible to create a simple tool button that can be put in a toolbar that just toggles a qualifier key on and off?
For example if you activate this button it can act as if the Alt key is being pressed and held down and when you deactivate this button it releases the Alt key?

Thank You

I don't think you'd want to do that as it would cause all sorts of strange behaviour.

I'm guessing you actually want to control something else, that can be triggered by holding down alt. There may be a better way to achieve that goal, if you tell us what it is.