rawKeyDown and Unicode

Richmond Mathewson richmondmathewson at gmail.com
Mon Sep 21 10:56:08 EDT 2009


Err . . . here I am replying to my own posting again: but,
any other person out there who is loony enough to be
mucking around with unicode might find the effects of
my 7th cup of coffee useful . . .  :)

I wrote:

-----------------------------

This works:

on mouseUp
set the useUnicode to true
set the unicodeText of fld "BLURB" to the unicodeText of fld "BLURB" & 
numToChar(2000)
select after fld "BLURB"
end mouseUp

this appends the unicode char 2000 to my textField

BUT this doesn't:

on rawKeyDown RAWK
  set the useUnicode to true
     if RAWK = 0 then
       set the useUnicode to true
       set the unicodeText of fld "BLURB" to the unicodeText of fld 
"BLURB" & numToChar(2000)
       select after fld "BLURB"
    end if
    pass rawKeyDown
end rawKeyDown

this appends the ascii equivalent (i.e. rem 2000)

-----------------------------------

this ONLY doesn't work if the rawKeyDown value is 0  (zero).

So:

on rawKeyDown RAWK
  set the useUnicode to true
     if RAWK = 49 then
       set the useUnicode to true
       set the unicodeText of fld "BLURB" to the unicodeText of fld 
"BLURB" & numToChar(2000)
       select after fld "BLURB"
    end if
    pass rawKeyDown
end rawKeyDown

works absolutely fine.
-----------------------------------------

And to think that I never took any notice of my Philosophy
Prof. burbling on about the dangers of inductive reasoning!



More information about the use-livecode mailing list