Just give this a shot:
PHP Code:
//#CLIENTSIDE
function GraalControl.onKeyDown(keycode, keystring, scancode) {
player.chat = keycode SPC keystring SPC scancode;
}
Then hit a couple keys. You should be using keycode for compatibility reasons if possible, since that's what seems to be uniform across the different platforms.