views:

41

answers:

1

I am getting key events that contain asci key codes and I was wondering if there was any easy way to convert these to the actual key or character in common lisp. I am using the ccl implementation which does not include int-char (which may or may not have worked for this task).

+6  A: 

You can use the code-char function. It will return the character encoded by given integer. Bear in mind that CCL uses Unicode, not pure 7-bit ASCII.

dmitry_vk
Awesome thank you! But it seems that my event gives me apple key-codes and code-char expects asci values. For example my event gives me the key code 0 when a is pressed and for code-char to return #\a you would need to call (code-char 97). Is there any conversion mechanism?
Mike2012