1

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

Ray Mairlot
  • 29,192
  • 11
  • 103
  • 125
Werwack
  • 161
  • 5
  • Btw I would also like to add that I am very likely in a non-modal context. – Werwack Jun 24 '20 at 08:51
  • I found some more clues in the documentation on the "prop" type: https://docs.blender.org/api/current/bpy.types.UILayout.html#bpy.types.UILayout.prop (look at the arguments event and full-event) And this thread provides some lights too but not all the parts of this puzzle: https://blender.stackexchange.com/questions/71537/what-are-the-parameters-event-and-full-event-of-uilayout-are-for/184175#184175 – Werwack Jun 26 '20 at 00:09

0 Answers0