you can use getter/setter
functions for these kind of updates or can check them in modal
functions by checking left clicks
.
an example of getter/setter
functions is described in API like below:
import bpy
# Simple property reading/writing from ID properties.
# This is what the RNA would do internally.
def get_float(self):
# do some stuff here before get
return self.myfloatget("myfloat",0.0)
# self in this method is the object which you attach the property to
# in this case self is any scene in bpy.data for example bpy.data.scenes[0]
def set_float(self, value):
# do some stuff here before/after set because no return is required
self.myfloatself["myfloat"] = value
bpy.types.Scene.myfloat = bpy.props.FloatProperty(get=get_float, set=set_float)
now whenever you get/set a scene.myfloat
data above methods work.