Bugfix:
3D text object editing, ALT+Backspace trick is back to construct special characters. Like: O , Alt+Backspace , / creates an O with a / in it. It also makes plus-minus, unequal, copyright, 1/2, 3/4. etc. Easy method you never forget after using once! Got broken with adding UTF support a year ago.
This commit is contained in:
@@ -1251,8 +1251,12 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
|
||||
else
|
||||
ascii = 9;
|
||||
}
|
||||
else if (event == BACKSPACEKEY)
|
||||
ascii = 0;
|
||||
|
||||
if (event == BACKSPACEKEY) {
|
||||
if (alt && cu->len != 0 && cu->pos > 0)
|
||||
accentcode = 1;
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
}
|
||||
|
||||
if (val && (ascii || evt->utf8_buf[0])) {
|
||||
/* handle case like TAB (== 9) */
|
||||
@@ -1263,19 +1267,19 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
|
||||
(evt->utf8_buf[0]))
|
||||
{
|
||||
|
||||
if (evt->utf8_buf[0]) {
|
||||
BLI_strncpy_wchar_from_utf8(inserted_text, evt->utf8_buf, 1);
|
||||
ascii = inserted_text[0];
|
||||
insert_into_textbuf(obedit, ascii);
|
||||
accentcode = 0;
|
||||
}
|
||||
else if (accentcode) {
|
||||
if (accentcode) {
|
||||
if (cu->pos > 0) {
|
||||
inserted_text[0] = findaccent(ef->textbuf[cu->pos - 1], ascii);
|
||||
ef->textbuf[cu->pos - 1] = inserted_text[0];
|
||||
}
|
||||
accentcode = 0;
|
||||
}
|
||||
else if (evt->utf8_buf[0]) {
|
||||
BLI_strncpy_wchar_from_utf8(inserted_text, evt->utf8_buf, 1);
|
||||
ascii = inserted_text[0];
|
||||
insert_into_textbuf(obedit, ascii);
|
||||
accentcode = 0;
|
||||
}
|
||||
else if (cu->len < MAXTEXT - 1) {
|
||||
if (alt) {
|
||||
/* might become obsolete, apple has default values for this, other OS's too? */
|
||||
@@ -1312,12 +1316,6 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
|
||||
text_update_edited(C, scene, obedit, 1, FO_EDIT);
|
||||
}
|
||||
}
|
||||
else if (val && event == BACKSPACEKEY) {
|
||||
if (alt && cu->len != 0 && cu->pos > 0)
|
||||
accentcode = 1;
|
||||
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
}
|
||||
else
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
|
||||
@@ -1330,7 +1328,8 @@ static int insert_text_invoke(bContext *C, wmOperator *op, wmEvent *evt)
|
||||
}
|
||||
|
||||
/* reset property? */
|
||||
accentcode = 0;
|
||||
if (val == 0)
|
||||
accentcode = 0;
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user