View Single Post
While a key is pressed
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default While a key is pressed - 05-03-2013, 01:29 PM

Are there any guidelines for what movements, calls etc. are allowed during a "While a key is pressed" event?
I have run across several things that seem to through an exception (usually, if not always a null pointer) when I release a key that is generating events using this method. The problem with its sister event "When a key is pressed" is that it is slow, jerky, and does not react until the key is released. Judging from my reading of the error report given in the message window (like trying to read Russian with nothing but a Chinese to English dictionary ) The method that was being called has vanished in the middle of its execution.
While the error seems to happen eventually when using a method, no matter what is being done in the method, calling another method or function during the event handler is almost guaranteed to cause an exception.

Again, I am just wondering if there are any guidelines on how to avoid this problem when using the While a key is pressed method.

Mark
   
Reply With Quote