Detect user event (bpy.types.Event) anywhere from blender?
What i really need is bpy.Types.event, unfortunately, it is only accessible from an Operator invoke() or modal()
so here's the trick
_event = None  

class SCATTER5_OT_get_event(bpy.types.Operator):
    bl_idname  = &quot;scatter5.get_event&quot;
    bl_label   = &quot;&quot;

    def invoke(self, context, event):
        global _event
        _event = event
        return {'FINISHED'}

def get_event():
    global _event
    bpy.ops.scatter5.get_event('INVOKE_DEFAULT')
    return _event

event = get_event()

to get event from anywhere in your script
what would have been be nice is something like bpy.context.window_manager.event, unfortunately this API does not exist (not sure why this type is only accessible from operators?)
Also, it would be ideal if there was a built-in python module that can detect keyboard input, unfortunately, I didn't find one.
feel free to propose an alternative method

example of implementation by @batFINGER
press alt/shift/ctrl/oskey while interacting with foo prop
import bpy
​
_event = None  
​
class SCATTER5_OT_get_event(bpy.types.Operator):
    bl_idname  = &quot;scatter5.get_event&quot;
    bl_label   = &quot;&quot;
​
    def invoke(self, context, event):
        global _event
        _event = event
        return {'FINISHED'}
​
def get_event(exec_context='INVOKE_DEFAULT'):
    global _event
    bpy.ops.scatter5.get_event(exec_context)
    return _event
​
def foo(self, context):
    event = get_event('INVOKE_REGION_WIN')
    print(
        &quot;Shift&quot; if event.shift else &quot;&quot;,
        &quot;Alt&quot; if event.alt else &quot;&quot;,
        &quot;Ctrl&quot; if event.ctrl else &quot;&quot;,
        &quot;OSKey&quot; if event.oskey else &quot;&quot;,
        event.value)
    
def draw(self, context):
    ob = context.object
    if ob:
        self.layout.prop(ob, &quot;foo&quot;)
​
def register():
    bpy.types.Object.foo = bpy.props.IntProperty(
            update=foo,
            )
    bpy.utils.register_class(SCATTER5_OT_get_event)
    bpy.types.TEXT_HT_footer.prepend(draw)
    
if __name__ == &quot;__main__&quot;:
    register()