0

I was wondering if there was a way to save keycodes in a variable that can be used in a function comparing that saved variable with the key that was pressed to trigger the function.

I.e - I am trying to save a keyCode in a variable for use in a function that checks if the key pressed is the same as the saved keyCode

1
  • Can you describe a little more clearly what you're trying to do? Commented Aug 30, 2013 at 6:49

1 Answer 1

1

There is already a class, Keyboard, which has a static list of the keycodes you could want:

import flash.ui.Keyboard;

trace(Keyboard.A); // 65
Sign up to request clarification or add additional context in comments.

1 Comment

Had none of Keyboard.A available, then updated FlashDevelop - there it is. I had to accommodate to this previously :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.