I have a handler in a field which I want to use to insert a particular Unicode character when a key is pressed
on rawKeyDown theKeyNumber
if theKeyNumber is 91 then -- code 91 is '['
-- insert Unicode character
-- ɛ
-- = U025B, latin small letter open e
-- or 603 in decimal
-- at cursor position in the current field
set the useUnicode to true
put unicode numToChar(603) into selection
else pass rawKeyDown -- don't forget this!
end rawKeyDown
Thus I would like to insert a Unicode character instead of the character directly generated by the keyDown event and thus not pass on the keyDown event.
The example is adapted from the example for the 'rawKeyDown' message in the LiveCode dictionary.