Passing modifier context

This is not a problem that needs to be solved, but rather a point of style. For a window operations menu, I have a function that PipeReads a script to create the menu based on an object and modifier context. The relevant contexts are:

  • Whether the focused window is an icon or not
  • Which if any of the Control ©, Shift (S), Alt (1), Command (4) keys are pressed

I know how to test for Iconic, but at least as far as I know, the modifier context is less straightforward. What I have now works like this:

Mouse 2 FST     N       CallOps
Mouse 2 FST     1       CallOps 1
Mouse 2 FST     S       CallOps S
Mouse 2 FST     S1      CallOps S1

DestroyFunc CallOps
AddToFunc CallOps
+ I DestroyMenu recreate Ops
+ I AddToMenu Ops
+ I PipeRead `$[FVWM_USERDIR]/menuscript/ops $[desk.n] $[0]`
+ I Popup Ops

It works fine, but I wonder if I’m not unaware of some internal variable or other approach I could use to avoid writing separate function calls for each possible modifier context, and stating it twice in each individual call. If not, so be it, but in the interest of writing the cleanest code possible I thought I would ask.