cmproductions
1 post
|
Hey guys does anyone know where I can get a list of the key codes?
e.g. “Key.isDown(35)” and all the number codes.
Sorry I know I could just look it up but I don’t have much time and I have to go to sleep! I’ll check the thread in the morning.
Thanks to everyone who posts!
|
|
|
pixtiz
92 posts
|
you can search in Flash Help (Help can help sometimes you know).
My entries are in french but search for “Key.getCode” and look in the “AS 2.0 formation” section ;)
|
|
|
arcaneCoder
2354 posts
|
Heres the page from the online version of the Flash help: Keyboard Keys and Key Code Values
|
|
|
IndieFlashAr...
433 posts
|
What I did, personally, is write a very simple .swf file (as detailed in the Flash help files) that traces the key code of any key that you press. Wow, it just doesn’t get any easier than that…
|
|
|
Mauser
25 posts
|
“What I did, personally, is write a very simple .swf file (as detailed in the Flash help files) that traces the key code of any key that you press. Wow, it just doesn’t get any easier than that…”
Wow! Smart idea!
Although thanks arcaneCoder fir the link. I’ll definitely be using that reference! =)
mauser
|
|
|
richpixel
4 posts
|
So what I did, after getting tired of always looking key codes up was write a KeyCode class which I include with my games. So when you want the “b” key, you just do this: “Key.isDown(KeyCode.B)”
class KeyCode
{
static public var SPACE:Number = 32;
static public var UP:Number = 38;
static public var DOWN:Number = 40;
static public var LEFT:Number = 37;
static public var RIGHT:Number = 39;
static public var A:Number = 65;
static public var B:Number = 66;
static public var C:Number = 67;
static public var D:Number = 68;
static public var E:Number = 69;
static public var F:Number = 70;
static public var G:Number = 71;
static public var H:Number = 72;
static public var I:Number = 73;
static public var J:Number = 74;
static public var K:Number = 75;
static public var L:Number = 76;
static public var M:Number = 77;
static public var N:Number = 78;
static public var O:Number = 79;
static public var P:Number = 80;
static public var Q:Number = 81;
static public var R:Number = 82;
static public var S:Number = 83;
static public var T:Number = 84;
static public var U:Number = 85;
static public var V:Number = 86;
static public var W:Number = 87;
static public var X:Number = 88;
static public var Y:Number = 89;
static public var Z:Number = 90;
static public var ONE:Number = 49;
static public var TWO:Number = 50;
static public var THREE:Number = 51;
static public var FOUR:Number = 52;
static public var FIVE:Number = 53;
static public var SIX:Number = 54;
static public var SEVEN:Number = 55;
static public var EIGHT:Number = 56;
static public var NINE:Number = 57;
static public var ZERO:Number = 48;
}
|
|
|
arcaneCoder
2354 posts
|
So what I did, after getting tired of always looking key codes up was write a KeyCode class which I include with my games.
Ya, I did the same thing. I just bind keys (or macros) to functions using a single command in the key manager. It takes care of all the repeat/non repeat issues, as well as the flash multi-key pressing complications.
|
|
|
Mauser
25 posts
|
Thanks for the source richpixel!
|
|
|
IndieFlashAr...
433 posts
|
Wow, it just doesn’t get any easier than that…
Thanks to RichPixel for proving me wrong :)
|
|
|
Mauser
25 posts
|
Using the key codes I just finished a ‘’change through your weapons’‘/’’next/prev weapon) controller! All I have to do is add it to my next project! =)
I used E (69) and Q(89).
|