Commit f6b5cd1d authored by Albert Gräf's avatar Albert Gräf
Browse files

Experimental: enable curly braces as ordinary characters.

This change allows curly braces {} to be accepted as keypress events and entered into object and message boxes. It doesn't change the quoting rules for these characters, so [print] still escapes them with backslashes.
parent c0086460
......@@ -168,7 +168,7 @@ function substitute_space(arg) {
}
function strip_problem_chars(arg) {
var problem_chars = [";", ",", "{", "}", "\\"];
var problem_chars = [";", ","/*, "{", "}"*/, "\\"];
var ret = arg;
for(var i = 0; i < problem_chars.length; i++) {
ret = ret.split(problem_chars[i]).join("");
......
......@@ -346,7 +346,7 @@ function substitute_space(arg) {
}
function strip_problem_chars(arg) {
var problem_chars = [";", ",", "{", "}", "\\"],
var problem_chars = [";", ","/*, "{", "}"*/, "\\"],
ret = arg,
i;
for(i = 0; i < problem_chars.length; i++) {
......
......@@ -49,7 +49,7 @@ function text_to_fudi(text) {
text = text.replace(/(\$[0-9]+)/g, "\\$1"); // escape dollar signs
text = text.replace(/(\$@)/g, "\\$@"); // escape special $@ sign
text = text.replace(/(?!\\)(,|;)/g, " \\$1 "); // escape "," and ";"
text = text.replace(/\{|\}/g, ""); // filter "{" and "}"
//text = text.replace(/\{|\}/g, ""); // filter "{" and "}"
text = text.replace(/\u0020+/g, " "); // filter consecutive ascii32
return text;
}
......
......@@ -4946,7 +4946,7 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av)
else gotkeysym = gensym("?");
//fflag = (av[0].a_type == A_FLOAT ? av[0].a_w.w_float : 0);
keynum = (av[1].a_type == A_FLOAT ? av[1].a_w.w_float : 0);
if (keynum == '\\' || keynum == '{' || keynum == '}')
if (keynum == '\\' /*|| keynum == '{' || keynum == '}'*/)
{
post("keycode %d: dropped", (int)keynum);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment