<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>I was using the filter to operate on key codes but I never did learn how to get a ASCII character from a UniChar in a decent way. I know I could wrap it into a CFString and convert the character from there, but that's a lot of code for such a simple operation. that snippet seems to accomplish that but i'm not sure what "reinterpret_cast" is. Is there a common utility for this? thanks again.</DIV><BR><DIV><DIV>On Oct 14, 2007, at 8:11 PM, Alfred Van Hoek wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><BR><DIV><DIV>On Oct 14, 2007, at 8:26 AM, Brother Josef wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>It was my understanding that returning false from the text filter hook would prevent WASTE from inserting the character but my callback is not producing these results. If that is not the usage of the callback how can I achieve these effects? thank you.</DIV><BR><DIV><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV style="; font-family: Helvetica; font-size: 12px; "><FONT class="Apple-style-span" face="Verdana" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;; font-family: Verdana; "><SPAN class="Apple-style-span" style="font-family: Verdana; font-size: 13px; ">Regards, </SPAN></SPAN></FONT></DIV><DIV style="; font-family: Helvetica; font-size: 12px; "><FONT class="Apple-style-span" face="Verdana" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;; font-family: Verdana; "><SPAN class="Apple-style-span" style="font-family: Verdana; font-size: 13px; ">        Josef</SPAN></SPAN></FONT></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN></SPAN></SPAN></DIV></SPAN></BLOCKQUOTE></DIV><BR><DIV><BR class="khtml-block-placeholder"></DIV><DIV>returning true should tell WASTE to not insert the text, example:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>// special case</DIV><DIV>    if ( GetHandleSize ( inFilterableText ) == sizeof ( UniChar ) &amp;&amp;</DIV><DIV>         * reinterpret_cast &lt; const UniChar * &gt; ( * inFilterableText ) == '\t' )</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                        </SPAN>// we need to make sure Waste is not handling the tab key input</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                        </SPAN>// in order to do so we need not only return true, telling Waste </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                        </SPAN>// we have handled it, but also we need to set the handle size to</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                        </SPAN>// zero. This will ensure that the your runtime can handle the tab key</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                        </SPAN>// event. In this case, advancing the focus.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                        </SPAN>SetHandleSize(inFilterableText, 0);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">                        </SPAN>return true;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Alfred</DIV></BLOCKQUOTE></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV style="; font-family: Helvetica; font-size: 12px; "><FONT class="Apple-style-span" face="Verdana" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;">Regards, </SPAN></FONT></DIV><DIV style="; font-family: Helvetica; font-size: 12px; "><FONT class="Apple-style-span" face="Verdana" size="3"><SPAN class="Apple-style-span" style="font-size: 13px;">        Josef</SPAN></FONT></DIV><DIV style="font-family: Helvetica; font-size: 12px; "><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN></SPAN></SPAN> </DIV><BR></BODY></HTML>