Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   keyname() (https://forums.graalonline.com/forums/showthread.php?t=68962)

projectigi 09-25-2006 10:52 PM

keyname()
 
PHP Code:

echo("keycode of a: " getkeycode("a"));
echo(
"keyname of a: " keyname(getkeycode("a"))); 

this says

keycode of a: 65
keyname of a:

shouldn it be

keycode of a: 65
keyname of a: a

?(clientside) =(

Yen 09-25-2006 10:54 PM

I think there was some problem with keyname in the past.. It's only clientside, maybe?

Try #k(int)

projectigi 09-25-2006 11:22 PM

ehr
that (clientside) at the end should express that im trying it clientside o.o
and i dont really use gs1 =/ it doesnt fit well with gs1

any other idea?

Yen 09-25-2006 11:31 PM

It's a hack. I'm pretty sure I had to use #k() instead of keyname() for something.

projectigi 09-26-2006 10:37 AM

PHP Code:

echo("keycode of a: " getkeycode("a"));
echo(
"keyname of a: " #k(65)); 

same result:
keycode of a: 65
keyname of a:

ApothiX 09-26-2006 04:21 PM

It's #K for the keyname, not #k.

projectigi 09-26-2006 11:07 PM

ah that works, thanks
now why didnt keyname() work? Oo

Admins 09-28-2006 07:08 PM

a Keycode cannot be directly converted to character. I guess what you were trying to was conversion to and from ascii:

number = getascii("a") or getascii('a')
character = char(asciicode)

Often the key code is the same as ascii though (for a-z).
Also note that getascii() was bugged on serverside until a few days ago, I am not sure if the new npcserver has been uploaded to all machines yet.
keyname(0..10) is for knowing the name of the default game keys and works on clientside only.


All times are GMT +2. The time now is 11:12 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.