|
-
Ubi bene, ibi patria
Converting Key.getAscii value to character
My code is reading keystrokes using Key.addListener. That works great, but the only way I can convert the Key.getAscii value to a character is by doing it like this:
Code:
String.fromCharCode(Key.getAscii())
Is that correct or is there a better way? Am I right that KM doesn't support the 'chr' and 'ord' functions?
Everybody thinks of changing humanity,
Nobody thinks of changing himself.
-
Ubi bene, ibi patria
Bump...
Nobody?!?
Everybody thinks of changing humanity,
Nobody thinks of changing himself.
-
You did it the right way.
Both 'chr' and 'ord' were deprecated years ago.
-
Ubi bene, ibi patria
Thanks Wilbert, that was all I needed to know. 
It can be quite confusing looking at older AS examples and then finding out that the code won't work because of something like 'chr and 'ord'. But we'll get there.
Everybody thinks of changing humanity,
Nobody thinks of changing himself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|