diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index bf3c562f95f..929540f10ac 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -652,6 +652,12 @@ static int rna_Event_unicode_length(PointerRNA *ptr) } } +static bool rna_Event_is_repeat_get(PointerRNA *ptr) +{ + const wmEvent *event = ptr->data; + return event->is_repeat; +} + static float rna_Event_pressure_get(PointerRNA *ptr) { const wmEvent *event = ptr->data; @@ -2131,6 +2137,12 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Type", ""); + /* keyboard */ + prop = RNA_def_property(srna, "is_repeat", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_Event_is_repeat_get", NULL); + RNA_def_property_ui_text(prop, "Is Repeat", "The event is generated by holding a key down"); + /* mouse */ prop = RNA_def_property(srna, "mouse_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "x"); @@ -2728,6 +2740,12 @@ static void rna_def_keyconfig(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Key Modifier", "Regular key pressed as a modifier"); RNA_def_property_update(prop, 0, "rna_KeyMapItem_update"); + prop = RNA_def_property(srna, "repeat", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", KMI_REPEAT_IGNORE); + RNA_def_property_ui_text(prop, "Repeat", "Active on key-repeat events (when a key is held)"); + RNA_def_property_update(prop, 0, "rna_KeyMapItem_update"); + prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KMI_EXPANDED); |