Get key input status with bpy.types.Gizmo.test_select

I want to change the display according to the purpose of the gizmo with a combination of modifier keys. For example, pressing Ctrl will turn red, and pressing Shift will turn blue. This allows the user to understand the operation of the gizmo more intuitively.

Currently, bpy.types.Gizmo.test_select can only take “context” and “location” as arguments. Is there a way to check the current key status here?

Pablo’s PolyBuild improvements seem to allow you to modify the preview with modifier keys. I would like to do the same thing, but how does this work in python?
https://developer.blender.org/D5573