Accessing the key_modifier property for a key binding I would like to have multiply key bindings call the same operator. It would look something like:

type = 'ONE', key_modifier = 'W'
type = 'ONE', key_modifier = 'F'
type = 'ONE', key_modifier = 'Q'
type = 'TWO', key_modifier = 'W'
type = 'TWO', key_modifier = 'F'
type = 'TWO', key_modifier = 'Q'


and so on. I don't want to make a separate operator for each binding but the event type that is passed to invoke does not have a key_modifier property. Is there a way to access the key_modifier property somehow?

Thanks,

Denis
I found your question looking for the same issue. I found how to do it by looking at the code of Power Sequencer add-on.
After you define your shortcut you have to add a property to the keymap:
kmi = km.keymap_items.new(OPERATOR.bl_idname, 'LEFT_ARROW', 'PRESS')
setattr(kmi.properties, 'bool_property', True)

Then read that property from the operator:
class OPERATOR(Operator):
    bl_idname = &quot;operator.id&quot;
    bl_label = &quot;One operator&quot;
    bool_property: bpy.props.BoolProperty(
        name=&quot;A property&quot;, description=&quot;Does something&quot;, default=False
    )

    def execute(self, context):
        print(self.bool_property)

The operator's property you define retains its value after you call it from the shortcut, so remember to restore the property to its default value (or whatever you need) after the operator is called.