[WASTE-list] Text Filter callback

Brother Josef thykeeper at nerdshack.com
Tue Oct 16 19:47:56 EDT 2007


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.

On Oct 14, 2007, at 8:11 PM, Alfred Van Hoek wrote:


>

> On Oct 14, 2007, at 8:26 AM, Brother Josef wrote:

>

>> 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.

>>

>> Regards,

>> Josef

>>

>

>

> returning true should tell WASTE to not insert the text, example:

>

>

> // special case

> if ( GetHandleSize ( inFilterableText ) == sizeof ( UniChar ) &&

> * reinterpret_cast < const UniChar * > ( *

> inFilterableText ) == '\t' )

>

>

> // we need to make sure Waste is not handling the tab key input

> // in order to do so we need not only return true, telling Waste

> // we have handled it, but also we need to set the handle size to

> // zero. This will ensure that the your runtime can handle the

> tab key

> // event. In this case, advancing the focus.

>

> SetHandleSize(inFilterableText, 0);

>

> return true;

>

> Alfred


Regards,
Josef



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://six.pairlist.net/pipermail/waste-list/attachments/20071017/7634321b/attachment.htm>


More information about the WASTE-list mailing list