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/editors/interface/interface_templates.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/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index f8fbc2d01a6..32b3bb5e926 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -609,7 +609,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
RNA_property_pointer_set(&template_ui->ptr, template_ui->prop, idptr, NULL);
RNA_property_update(C, &template_ui->ptr, template_ui->prop);
- if (id && CTX_wm_window(C)->eventstate->shift) {
+ if (id && CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) {
/* only way to force-remove data (on save) */
id_us_clear_real(id);
id_fake_user_clear(id);
@@ -635,7 +635,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
case UI_ID_LOCAL:
if (id) {
Main *bmain = CTX_data_main(C);
- if (CTX_wm_window(C)->eventstate->shift) {
+ if (CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) {
if (ID_IS_OVERRIDABLE_LIBRARY(id)) {
/* Only remap that specific ID usage to overriding local data-block. */
ID *override_id = BKE_lib_override_library_create_from_id(bmain, id, false);
@@ -5539,7 +5539,7 @@ static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
uiBut *but = arg1;
const int cur = POINTER_AS_INT(arg2);
wmWindow *win = CTX_wm_window(C);
- const int shift = win->eventstate->shift;
+ const bool shift = win->eventstate->modifier & KM_SHIFT;
if (!shift) {
const int tot = RNA_property_array_length(&but->rnapoin, but->rnaprop);