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
committerFabian Schempp <fabianschempp@googlemail.com>2022-04-11 01:30:13 +0300
commit0ffd83775dbca4ede82b0a4adfddfb92441dd87f (patch)
tree501dfa4b35134204560beb481fd54a8d5bedf4eb /source/blender/editors/space_text
parenta121afc30e20ab51e0d1d4dcb74040ed90ed3666 (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/space_text')
-rw-r--r--source/blender/editors/space_text/text_autocomplete.c4
-rw-r--r--source/blender/editors/space_text/text_ops.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c
index 496f500ef04..55873740491 100644
--- a/source/blender/editors/space_text/text_autocomplete.c
+++ b/source/blender/editors/space_text/text_autocomplete.c
@@ -408,7 +408,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
case EVT_BACKSPACEKEY:
if (event->val == KM_PRESS) {
if (tools & TOOL_SUGG_LIST) {
- if (event->ctrl) {
+ if (event->modifier & KM_CTRL) {
texttool_suggest_clear();
retval = OPERATOR_CANCELLED;
draw = 1;
@@ -445,7 +445,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
case EVT_RIGHTARROWKEY:
if (event->val == KM_PRESS) {
if (tools & TOOL_SUGG_LIST) {
- if (event->ctrl) {
+ if (event->modifier & KM_CTRL) {
texttool_suggest_clear();
retval = OPERATOR_CANCELLED;
draw = 1;
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index ddba6803f61..3c29b32c2fa 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -3495,7 +3495,7 @@ static int text_insert_invoke(bContext *C, wmOperator *op, const wmEvent *event)
* (when input method are used for utf8 inputs, the user may assign key event
* including alt/ctrl/super like ctrl+m to commit utf8 string. in such case,
* the modifiers in the utf8 character event make no sense.) */
- if ((event->ctrl || event->oskey) && !event->utf8_buf[0]) {
+ if ((event->modifier & (KM_CTRL | KM_OSKEY)) && !event->utf8_buf[0]) {
return OPERATOR_PASS_THROUGH;
}