Code:
vKey:=XKeycodeToKeysym(Event.xkey.display,Event.xkey.keycode,0);
this returns a Integer value which is mapped to the table in keysym unit. so for the up key = XK_Up = $FF52; { Move up, up arrow }
you will have to use this table to convert them to something else.