[Openmcl-devel] Character Code Requests

Brent Fulgham bfulg at pacbell.net
Mon Jan 29 23:01:05 PST 2007

I was wondering if the following additions could be made to the  
standard character registration functions in level-1/l1-reader.lisp:

Request #1:
Existing MCL refers to several character codes that are probably not  
valid on modern systems.  Still, to make porting applications easier,  
it would be nice if the following character codes could be provided:

("BackArrow" . #\01C)
("ForwardArrow" . #\01D)
("UpArrow" .  #\01E)
("DownArrow" . #\01F)

This would at least avoid having to conditionalize these values using  
reader macros.

Request #2:
The new key codes in Cocoa event handlers are in a much higher range,  
so I would propose something along the lines of:

(ccl::register-character-name "RightArrowFunctionKey" # 
(ccl::register-character-name "LeftArrowFunctionKey"    # 
(ccl::register-character-name "UpArrowFunctionKey"      # 
(ccl::register-character-name "DownArrowFunctionKey"    # 

Unfortunately, even if I ignore the dire warnings of thread-unsafety  
and make use fo the REGISTER-CHARACTER-NAME function, I find that the  
CHAR-CODE and CODE-CHAR functions don't do what I would expect:

? #$NSRightArrowFunctionKey
? (char-code #\RightArrowFunctionKey)
 > Error: value 63235 is not of the expected type CHARACTER.
 > While executing: CHAR-CODE, in process Listener(4).
 > Type :POP to abort, :R for a list of available restarts.
 > Type :? for other options.
 > :pop

? (code-char 63235)

Could we add the NS key-codes (at least for the cursor keys, and  
perhaps function keys) to those recognized by CODE-CHAR/CHAR-CODE?



More information about the Openmcl-devel mailing list