2013-04-13 31 views
0

我有,我想用插入一个特定的Unicode字符时,按下一个键如何在光标位置插入一个Unicode字符到字段

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 

因此,我将现场的处理程序喜欢插入一个Unicode字符而不是直接由keyDown事件生成的字符,因此不会传递keyDown事件。

该示例根据LiveCode字典中'rawKeyDown'消息的示例进行了修改。

回答

0

我编辑了这个问题。代码示例现在完成这项工作。

相关问题