屏蔽回車鍵 --精靈行為。 on keydown me if the key = return then nothing --屏蔽“阻斷”keydown事件! else pass --繼續下傳keydown事件! end if end
屏蔽f鍵 --精靈行為
on keydown me if the key = "f" then nothing --屏蔽“阻斷”keydown事件! else pass --繼續下傳keydown事件! end if end
另外,這里提供一個屏蔽字符串的行為供大家參考。如下,只能輸入a-z,1-9和-。
property spritenum , letters on keydown me if (letters contains the key ) then pass else beep end if end on getpropertydescriptionlist me p_list = [ # letters : [ # format : #string , # default : "abcdefghijklmnopqrstuvwxyz1234567890-" , # comment : "allowed characters:" ]] return p_list end