You could moreover add the following to the field's script.
on rawkeyup k
switch k
case 65288 -- backspace
put word 4 of the selectedChunk into cx
if char cx of me is among the items of \
(numToCodePoint(0x23CE),numToCodePoint(0x21E5),numToCodePoint(0x00B7))
then delete char cx of me
break
case 65535 -- forward delete
put word 2 of the selectedChunk into cx
if char cx of me is among the items of (numToCodePoint(0x200A),cr,tab)
then delete char cx of me
break
default
pass rawkeyup
end switch
end rawkeyUp
There is still more to do, e.g. when typing after a return symbol...
Hope you are (as I did) sharing your working edit code when done.
> > Kaveh wrote:
> > I need the user to edit as normal and with normal functionality but see the
> > normally
> > invisible characters. So seems I would need a native solution. :-(
>
> This works for me (TMHO, this demonstrates the beauty of LC).
> Script your field with the following.
>
> on rawkeyDown k
> switch k
> case 32 -- space
> put numToCodePoint(0x00B7)&numToCodePoint(0x200A) into the selection
> break
> case 65293 -- return
> put numToCodePoint(0x23CE)&cr into the selection
> break
> case 65289 -- tab
> -- put tab&numToCodePoint(0x21E5) into the selection -- alternate
> put numToCodePoint(0x21E5)&tab into the selection
> break
> default
> pass rawkeydown
> end switch
> end rawkeyDown
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode