Question
List of KeyCodes?
In my Flash project, I know that the KeyCode recognizes 37-40
for the up/down/left/right arrow keys.
if (event.keyCode == 37) {
hero.moveLeft = true;
} else if (event.keyCode == 39) {
hero.moveRight = true;
}
if (event.keyCode == 38) {
hero.moveUp = true;
} else if (event.keyCode == 40) {
hero.moveDown = true;
}
And 32 as the spacebar at least. I was trying to make it so that the "s" or "i" or "g" key were recognized but when I did a trace on what keyCode value was picking up it would not recognize the "s" key unless I pressed the shift key. Oddly the "d" key would be recognized. While I am contempt on using the spacebar and other control keys instead, I was wondering if there's a chart somewhere as to what is recognized as keyCode, or if there's another property being used that recognizes the actual character representation instead (ie. 115=s, 37=%).
if (event.keyCode == 37) {
hero.moveLeft = true;
} else if (event.keyCode == 39) {
hero.moveRight = true;
}
if (event.keyCode == 38) {
hero.moveUp = true;
} else if (event.keyCode == 40) {
hero.moveDown = true;
}
And 32 as the spacebar at least. I was trying to make it so that the "s" or "i" or "g" key were recognized but when I did a trace on what keyCode value was picking up it would not recognize the "s" key unless I pressed the shift key. Oddly the "d" key would be recognized. While I am contempt on using the spacebar and other control keys instead, I was wondering if there's a chart somewhere as to what is recognized as keyCode, or if there's another property being used that recognizes the actual character representation instead (ie. 115=s, 37=%).
