diff options
author | Ton Roosendaal <ton@blender.org> | 2010-12-10 16:31:59 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-12-10 16:31:59 +0300 |
commit | 9aace59708c6cf5471c661feb6207f1eca923a17 (patch) | |
tree | 516d4713bcc449562c63199acac19d5554eb660f /source/blender/editors/curve | |
parent | 5854cfa5b8b1af7c451b56482a0a2b54b6c679de (diff) |
IRC report fix:
Text edit mode (3d): brought back the ALT+Backspace mode for
typing accented characters. Works with an operator property,
so the hotkey for it is free to define.
Example: type 'a', alt+backspace and then 'o'
works to combine characters with ' ` ~ o / and ^
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/curve_ops.c | 1 | ||||
-rw-r--r-- | source/blender/editors/curve/editfont.c | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 9f67b9d6c06..b454202fc11 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -189,6 +189,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "FONT_OT_line_break", RETKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FONT_OT_text_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last! + RNA_boolean_set(WM_keymap_add_item(keymap, "FONT_OT_text_insert", BACKSPACEKEY, KM_PRESS, KM_ALT, 0)->ptr, "accent", 1); // accented characters /* only set in editmode curve, by space_view3d listener */ keymap= WM_keymap_find(keyconf, "Curve", 0, 0); diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index ef49abd4dbd..0010332c8d9 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1259,6 +1259,12 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt) if(RNA_property_is_set(op->ptr, "text")) return insert_text_exec(C, op); + + if(RNA_property_is_set(op->ptr, "accent")) { + if(cu->len!=0 && cu->pos>0) + accentcode= 1; + return OPERATOR_FINISHED; + } /* tab should exit editmode, but we allow it to be typed using modifier keys */ if(event==TABKEY) { @@ -1333,6 +1339,9 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt) RNA_string_set(op->ptr, "text", inserted_utf8); } + /* reset property? */ + accentcode= 0; + return OPERATOR_FINISHED; } @@ -1353,6 +1362,7 @@ void FONT_OT_text_insert(wmOperatorType *ot) /* properties */ RNA_def_string(ot->srna, "text", "", 0, "Text", "Text to insert at the cursor position."); + RNA_def_boolean(ot->srna, "accent", 0, "Accent mode", "Next typed character will strike through previous, for special character input."); } |