Hi list,
which characters are 'forbidden' in Pd message boxes? E.g. I'm unable to type a backslash or curly braces. I get the following error message:
'keycode #N dropped' (where #N is the ASCII code).
I tried both on German and English keyboard layout. I'm on Win 7.
I noticed that in the help file for [text fromlist] you can see a backslash in the message box (apparantly used to escape the semicolons), so I guess it should be possible...
Also, could someone have a look at the attached patch and check if they get the same errors as me?
Christof
On 2016-07-26 13:01, Christof Ressi wrote:
which characters are 'forbidden' in Pd message boxes? E.g. I'm unable to type a backslash or curly braces. I get the following error message:
'keycode #N dropped' (where #N is the ASCII code).
yes this is expected behaviour, on all operating systems. among other things, this prevents w32 users from using backslash as directory delimiter¹.
the list of forbidden characters is exactly this: , {, }
fgmasdr IOhannes
¹ though of course this is not the real reason why these keys are forbidden.
Le 26/07/2016 à 13:44, IOhannes m zmoelnig a écrit :
'keycode #N dropped' (where #N is the ASCII code).
yes this is expected behaviour, on all operating systems. among other things, this prevents w32 users from using backslash as directory delimiter¹.
the list of forbidden characters is exactly this: , {, }
fgmasdr IOhannes
¹ though of course this is not the real reason why these keys are forbidden.
backslashes are used for keeping dollar sign in pd patches,
this also involves sometimes some bugs when we try to put tcl variables in a patch, it does happen when we try to interpret tcl code with [hc/sys_gui].
This is also one of the main reasons why I try to replace tcl scripts in my patches with pdlua objects and still looking for a decent third party graphical toolkit that could be coded without compiling.
br
though of course this is not the real reason why these keys are forbidden.
so what is the real reason?
to me it feels weird that these three characters (which are omnipresent in most languages) should be totally forbidden in Pd. right now it seems like I can't build things like regular expressions, java script code or JSON data in a way which isn't totally akward and defeats the purpose of human-readable formats.
after some more trying I discovered that I can actually safely type '{' and '}' within a [text] window, although I still get the 'keycode dropped' error in the console. '' on the other hand only works together with ';' to escape the semicolon. apart from that it will always be dropped.
some questions:
why can I type curly braces in [text] but not in a message box?
why can I escape a semicolon in [text] but not in a message box?
even if there should be a serious technical reason for why a user shall not be able to type these characters in a message box, would it at least be possible to create them dynamically, e.g. with a message similar to 'addsemi', 'addcomma' or 'adddollar'?
Christof
Gesendet: Dienstag, 26. Juli 2016 um 13:44 Uhr Von: "IOhannes m zmoelnig" zmoelnig@iem.at An: pd-list@lists.iem.at Betreff: Re: [PD] unable to type certain characters
On 2016-07-26 13:01, Christof Ressi wrote:
which characters are 'forbidden' in Pd message boxes? E.g. I'm unable to type a backslash or curly braces. I get the following error message:
'keycode #N dropped' (where #N is the ASCII code).
yes this is expected behaviour, on all operating systems. among other things, this prevents w32 users from using backslash as directory delimiter¹.
the list of forbidden characters is exactly this: , {, }
fgmasdr IOhannes
¹ though of course this is not the real reason why these keys are forbidden.
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 2016-07-26 15:50, Christof Ressi wrote:
though of course this is not the real reason why these keys are forbidden.
so what is the real reason?
to me it feels weird that these three characters (which are omnipresent in most languages)
this is the reason why they are forbidden: these characters have a special meaning in tcl/tk and rather than properly escaping them (and going through hell) they are just forbidden (which saves the devs a lot of hassle).
should be totally forbidden in Pd. right now it seems like I can't build things like regular expressions, java script code or JSON data in a way which isn't totally akward and defeats the purpose of human-readable formats.
well, those use-cases should be catered for easily enough: just use some
other characters instead of the forbidden ones, and replace them before
doing the actual processing.
e.g. "{" -> "<<" and "}" -> ">>"
and then run the following json string through
sed -e 's|<<|{|g' -e '|>>|}|g'
:
["foo", <<"bar": ["baz", null, 1.0, 2]>>]
(only to discover that while you can type semicolons in Pd, they are treated somewhat special...)
after some more trying I discovered that I can actually safely type '{' and '}' within a [text] window, although I still get the 'keycode dropped' error in the console.
that's because the [text] window lacks character checker. it probably should be there as well.
some questions:
why can I type curly braces in [text] but not in a message box?
see above.
why can I escape a semicolon in [text] but not in a message box?
because you really cannot. (at least not in a way that is much more meaningful than the "keycode dropped" on the patch level)
even if there should be a serious technical reason for why a user shall not be able to type these characters in a message box, would it at least be possible to create them dynamically, e.g. with a message similar to 'addsemi', 'addcomma' or 'adddollar'?
well, it's pretty easy to create this characters: [makefilename %c] to the rescue.
fgasdmr IOhannes
thanks for your explanations! now I realize that it's a actually Tcl problem.
well, it's pretty easy to create this characters: [makefilename %c] to the rescue.
I already managed to create those characters as symbols with [list tosymbol]. as long as they don't make their way to the GUI, everything is fine :-). making JSON strings by appending lists and symbols is actually not that much of a hassle.
btw, maybe it's time to document all of the relevant format strings for [makefilename]. just in case Miller is reading this ;-).
Gesendet: Dienstag, 26. Juli 2016 um 16:17 Uhr Von: "IOhannes m zmoelnig" zmoelnig@iem.at An: "Christof Ressi" christof.ressi@gmx.at Cc: pd-list@lists.iem.at Betreff: Re: [PD] unable to type certain characters
On 2016-07-26 15:50, Christof Ressi wrote:
though of course this is not the real reason why these keys are forbidden.
so what is the real reason?
to me it feels weird that these three characters (which are omnipresent in most languages)
this is the reason why they are forbidden: these characters have a special meaning in tcl/tk and rather than properly escaping them (and going through hell) they are just forbidden (which saves the devs a lot of hassle).
should be totally forbidden in Pd. right now it seems like I can't build things like regular expressions, java script code or JSON data in a way which isn't totally akward and defeats the purpose of human-readable formats.
well, those use-cases should be catered for easily enough: just use some other characters instead of the forbidden ones, and replace them before doing the actual processing. e.g. "{" -> "<<" and "}" -> ">>" and then run the following json string through
sed -e 's|<<|{|g' -e '|>>|}|g'
: ["foo", <<"bar": ["baz", null, 1.0, 2]>>](only to discover that while you can type semicolons in Pd, they are treated somewhat special...)
after some more trying I discovered that I can actually safely type '{' and '}' within a [text] window, although I still get the 'keycode dropped' error in the console.
that's because the [text] window lacks character checker. it probably should be there as well.
some questions:
why can I type curly braces in [text] but not in a message box?
see above.
why can I escape a semicolon in [text] but not in a message box?
because you really cannot. (at least not in a way that is much more meaningful than the "keycode dropped" on the patch level)
even if there should be a serious technical reason for why a user shall not be able to type these characters in a message box, would it at least be possible to create them dynamically, e.g. with a message similar to 'addsemi', 'addcomma' or 'adddollar'?
well, it's pretty easy to create this characters: [makefilename %c] to the rescue.
fgasdmr IOhannes
On 2016-07-26 17:25, Christof Ressi wrote:
thanks for your explanations! now I realize that it's a actually Tcl problem.
well, it's pretty easy to create this characters: [makefilename %c] to the rescue.
I already managed to create those characters as symbols with [list tosymbol]. as long as they don't make their way to the GUI, everything is fine :-). making JSON strings by appending lists and symbols is actually not that much of a hassle.
btw, maybe it's time to document all of the relevant format strings for [makefilename]. just in case Miller is reading this ;-).
they are already well documented: man 3 printf
fgmasdr IOhannes
they are already well documented: man 3 printf
ok, now let's also mention 'printf' in the helpfile :-). although I'm pretty much familiar with C, I wouldn't have come to the idea that you can use all printf format strings (well, not really all of them) in [makefilename]... nice
Gesendet: Dienstag, 26. Juli 2016 um 17:36 Uhr Von: "IOhannes m zmoelnig" zmoelnig@iem.at An: pd-list@lists.iem.at Betreff: Re: [PD] unable to type certain characters
On 2016-07-26 17:25, Christof Ressi wrote:
thanks for your explanations! now I realize that it's a actually Tcl problem.
well, it's pretty easy to create this characters: [makefilename %c] to the rescue.
I already managed to create those characters as symbols with [list tosymbol]. as long as they don't make their way to the GUI, everything is fine :-). making JSON strings by appending lists and symbols is actually not that much of a hassle.
btw, maybe it's time to document all of the relevant format strings for [makefilename]. just in case Miller is reading this ;-).
they are already well documented: man 3 printf
fgmasdr IOhannes
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list