diff options
author | julianeisel <julian_eisel@web.de> | 2015-01-26 04:38:39 +0300 |
---|---|---|
committer | julianeisel <julian_eisel@web.de> | 2015-01-26 04:38:39 +0300 |
commit | b554bcf124f03d4cd3f7c5354b0dec64a7ebd38d (patch) | |
tree | dee79ae1548439b64b3a4364feb26ce179ab271d /source | |
parent | c792e546991bd96e92f15b34e5e7111838c723ff (diff) |
Cleanup: Remove ugly ELEM checks in modifier key handling
Campbell once told me such checks can cause warnings on some compilers, so
let's try to avoid them.
From the theoretical view, this check works quite different than the old
one, but in this case everything should work just like previousely.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 12 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index a24ff9960e2..7d1d9d7f279 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6344,7 +6344,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * } /* handle keyframing */ else if ((event->type == IKEY) && - !ELEM(KM_MOD_FIRST, event->ctrl, event->oskey) && + (event->ctrl + event->oskey == 0) && (event->val == KM_PRESS)) { if (event->alt) { @@ -6365,7 +6365,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * } /* handle drivers */ else if ((event->type == DKEY) && - !ELEM(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) && + ((event->ctrl + event->oskey + event->shift) == 0) && (event->val == KM_PRESS)) { if (event->alt) @@ -6379,7 +6379,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * } /* handle keyingsets */ else if ((event->type == KKEY) && - !ELEM(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift) && + ((event->ctrl + event->oskey + event->shift) == 0) && (event->val == KM_PRESS)) { if (event->alt) @@ -6392,9 +6392,9 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * return WM_UI_HANDLER_BREAK; } /* handle menu */ - else if (event->type == RIGHTMOUSE && - event->val == KM_PRESS && - ((event->ctrl + event->alt + event->shift) == 0)) + else if ((event->type == RIGHTMOUSE) && + ((event->ctrl + event->alt + event->shift) == 0) && + (event->val == KM_PRESS)) { /* RMB has two options now */ if (ui_but_menu(C, but)) { diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index e68c86353a3..d0637a23a70 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -1757,7 +1757,7 @@ int ui_handler_panel_region(bContext *C, const wmEvent *event, ARegion *ar) /* XXX hardcoded key warning */ if ((inside || inside_header) && event->val == KM_PRESS) { - if (event->type == AKEY && !ELEM(KM_MOD_FIRST, event->ctrl, event->oskey, event->shift, event->alt)) { + if (event->type == AKEY && ((event->ctrl + event->oskey + event->shift + event->alt) == 0)) { if (pa->flag & PNL_CLOSEDY) { if ((block->rect.ymax <= my) && (block->rect.ymax + PNL_HEADER >= my)) |