3 Replies Latest reply on Jul 12, 2013 7:25 AM by tyree_2

    disable key event

    tyree_2 Level 2

      Is there a way to disable keys from being pressed?

        • 1. Re: disable key event
          James Newton, ACP Level 3

          With current technology, you can't prevent the user from pressing keys, but you can ignore any key presses that they make. Here's a handler that will make your movie ignore everything except vowels:

           

          on startMovie()

            the keyDownScript = \

          "if "&QUOTE&"aeiou"&QUOTE&" contains the key then"&RETURN&\

          "    -- Let the key press be treated"&RETURN&\

          "  else"&RETURN&\

          "    stopEvent"&RETURN&\

          "  end if"

          end

           

           

          If the #keydown event is stopped then no sprite or member will receive an indication that a character has been typed.

           

          You might like to look at the keydown event handler and build your own custom solution.

          • 2. Re: disable key event
            tyree_2 Level 2

            what I need is to limit keys for a few seconds. this is to stop a key from being pressed then pressed immediately afterwards before it should be pressed again. Ill see If I can work this into that thanks

            • 3. Re: disable key event
              tyree_2 Level 2

              after trying the code it gave me an error after the 1st line. operand expected. but I made some progress by linking the button press to the animation time. pressing a button before an animation is finished. wont cause the button to fire. which is what I was after