[Openmcl-devel] Key Codes in OpenMCL

Brent Fulgham bfulg at pacbell.net
Sat Jan 13 23:55:28 PST 2007


I'm attempting to port some code that made use of MCL's key handling  
logic:

(defmethod VIEW-KEY-EVENT-HANDLER ((Self Window) Key)
   (let ((Delta 0.01))
     (case Key
       (#\ForwardArrow (incf (cursor-x Self) Delta))
       (#\BackArrow (decf (cursor-x Self) Delta))
       (#\UpArrow (incf (cursor-y Self) Delta))
       (#\DownArrow (decf (cursor-y Self) Delta))
       (#\space ...
       (#\+
       (#\-
            ... etc ...
  )))

Many of the necessary key codes are already available:

? #\space
#\
? #\+
#\+
? #\newline
#\Newline
? #\linefeed
#\Newline
? #\return
#\Return

However, the arrow keys (and some function keys) are not defined:

? #\delete
#\Backspace
? #\clear
#\ESC#\f1
? #\uparrow

 > Error: Unknown character name - "uparrow" .
 > While executing: #<Anonymous Function #x81CFAF6>, in process  
listener(1).
 > Type :POP to abort, :R for a list of available restarts.
 > Type :? for other options.
1 > #\UpArrow

The only thing I can find in the source tree related to the cursor  
keys are some hemlock-specific binding functions:

hemlock/src/bindings.lisp:(bind-key "Previous Line" #k"uparrow")
hemlock/unused/keytrandefs.lisp:(define-keysym 65362 #\uparrow #\s- 
uparrow)

How can I create my own identifiers for characters?

Thanks,

-Brent





More information about the Openmcl-devel mailing list