问题
I would have expected, given the way Adobe seems to do things, that you could reference some of the non-ASCII keycodes using a static constant, for example KeyCode.UP_KEY
. Am I dreaming? Or do you just assume 38 will be the up key in perpetuity..?
回答1:
I believe you are looking for the Keyboard
class
Keyboard.UP
will refer to the up key, Keyboard.DOWN
to the down key, and so on.
See http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Keyboard.html for more key codes.
来源:https://stackoverflow.com/questions/8110073/does-flash-pre-define-any-keycode-constants