locked
GraphicsWindow.LastKey Blows Up RRS feed

  • Question

  • The following code will accept 10 to 20 keystrokes and then blows up.  Any idea about what is going on?  Thanks!

    While "True"
      GraphicsWindow.KeyDown = Check
    EndWhile

    Sub Check
      myKey = GraphicsWindow.LastKey
    EndSub

    Sunday, June 28, 2009 1:08 AM

Answers

  • The while loop is completely unnesescary, this should work fine.

    GraphicsWindow.KeyDown = Check

    Sub Check
     mykey = GraphicsWindow.LastKey
    EndSub


    When you set GraphicsWindow.KeyDown = Check it will always be check and all the way through the program untell it is changed whenever a key is pressed it will go to Sub Check.

    • Proposed as answer by The Hacker Sunday, June 28, 2009 1:21 AM
    • Marked as answer by ClydeW Sunday, June 28, 2009 2:06 AM
    Sunday, June 28, 2009 1:21 AM

All replies

  • The while loop is completely unnesescary, this should work fine.

    GraphicsWindow.KeyDown = Check

    Sub Check
     mykey = GraphicsWindow.LastKey
    EndSub


    When you set GraphicsWindow.KeyDown = Check it will always be check and all the way through the program untell it is changed whenever a key is pressed it will go to Sub Check.

    • Proposed as answer by The Hacker Sunday, June 28, 2009 1:21 AM
    • Marked as answer by ClydeW Sunday, June 28, 2009 2:06 AM
    Sunday, June 28, 2009 1:21 AM
  • Thanks Hacker, that works just fine!

    Good Work!!
    Sunday, June 28, 2009 2:06 AM