I asked a similar - but slightly different - question already some time ago and I found a solution for a custom operator: How to detect if a modifier key is pressed when the value of a custom property is changed?
But now I would like to get the state of the keys of the keyboard while manipulating a custom property. In other words can I create an Event in a set or update function of a property?
def _get_stampInfoUsed(self):
val = self.get("stampInfoUsed", True)
# get Event here in some way...
if event.ctrl:
print("Ctrl Pressed")
def _set_stampInfoUsed(self, value):
self["stampInfoUsed"] = value
myProp: BoolProperty(
get = _get_stampInfoUsed,
set = _set_stampInfoUsed,
)
Thank you