diff options
-rw-r--r-- | source/blender/editors/space_console/console_ops.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 19 |
2 files changed, 17 insertions, 10 deletions
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 8ececa22163..3f04d0e4293 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -403,8 +403,14 @@ static int insert_exec(bContext *C, wmOperator *op) static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) { - if(!RNA_property_is_set(op->ptr, "text")) { + // if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ + if(!RNA_string_length(op->ptr, "text")) { char str[2] = {event->ascii, '\0'}; + + /* if alt/ctrl/super are pressed pass through */ + if(event->alt || event->ctrl || event->oskey) + return OPERATOR_PASS_THROUGH; + RNA_string_set(op->ptr, "text", str); } return insert_exec(C, op); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index ed70f31f970..e3bf390dba8 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2317,18 +2317,19 @@ static int insert_exec(bContext *C, wmOperator *op) static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) { - char str[2]; int ret; - /* XXX old code from winqreadtextspace, is it still needed somewhere? */ - /* smartass code to prevent the CTRL/ALT events below from not working! */ - /*if(qual & (LR_ALTKEY|LR_CTRLKEY)) - if(!ispunct(ascii)) - ascii= 0;*/ - str[0]= event->ascii; - str[1]= '\0'; + // if(!RNA_property_is_set(op->ptr, "text")) { /* always set from keymap XXX */ + if(!RNA_string_length(op->ptr, "text")) { + char str[2] = {event->ascii, '\0'}; + + /* if alt/ctrl/super are pressed pass through */ + if(event->alt || event->ctrl || event->oskey) + return OPERATOR_PASS_THROUGH; + + RNA_string_set(op->ptr, "text", str); + } - RNA_string_set(op->ptr, "text", str); ret = insert_exec(C, op); /* run the script while editing, evil but useful */ |