Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-02-24 14:48:34 +0300
committerCampbell Barton <campbell@blender.org>2022-02-25 09:58:22 +0300
commitad0b3abf539bbb358f799d3f36649b5d46f222c8 (patch)
treed7aff552c5541880ca1ce2648595455418cafc56 /source/blender/makesrna/intern/rna_wm.c
parente7cae5187773f41e62830be597c6f598bff0653f (diff)
Cleanup: use flags for wmEvent modifier keys
Using flags makes checking multiple modifiers at once more convenient and avoids macros/functions such as IS_EVENT_MOD & WM_event_modifier_flag which have been removed. It also simplifies checking if modifier keys have changed.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index b0021bd0f3d..16d1dc0e93f 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -2194,23 +2194,23 @@ static void rna_def_event(BlenderRNA *brna)
/* modifiers */
prop = RNA_def_property(srna, "shift", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "shift", 1);
+ RNA_def_property_boolean_sdna(prop, NULL, "modifier", KM_SHIFT);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Shift", "True when the Shift key is held");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_WINDOWMANAGER);
prop = RNA_def_property(srna, "ctrl", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "ctrl", 1);
+ RNA_def_property_boolean_sdna(prop, NULL, "modifier", KM_CTRL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Ctrl", "True when the Ctrl key is held");
prop = RNA_def_property(srna, "alt", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "alt", 1);
+ RNA_def_property_boolean_sdna(prop, NULL, "modifier", KM_ALT);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Alt", "True when the Alt/Option key is held");
prop = RNA_def_property(srna, "oskey", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "oskey", 1);
+ RNA_def_property_boolean_sdna(prop, NULL, "modifier", KM_OSKEY);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "OS Key", "True when the Cmd key is held");