This content has been marked as final. Show 4 replies
This suggests you have a behavior attached to the text sprite. You'll
need to trap these keys in your keyDown/Up handler and stop them from
being "displayed" with 'stopEvent'
Thanks for your solution but it is quite difficult to do, cos the users can input chinese character which is a combination of serveral keys together to make a character, if I trap the keyup and keydown, it is difficult for them to type chinese.
Try adding a behavior to your text sprite with this scriptText:
--put the keyCode, the key
case the keyCode of
115: -- Home
116: -- Page Up
119: -- End
121: -- Page Down
This should block the keys you mention, and let all other key inputs pass to the text member where they will be displayed. If there are other keys that you want to block, uncomment the first line; you will then see output in the Message window each time you type a letter. This will let you know what other keyCodes you should add to the case statement.
Sure, I will have a try to see if it can do in my situation, but really want to ask why Director lets Text box accepts these characters, it is strange.
Anyway, thanks a lot!