CLIM mail archive


Re: Support for special keys

  Date: Thu, 24 Feb 94 15:23:03 -0800
  From: "Philip L. Stubblefield" <>

  CLIM 1.1
  Allegro CL 4.1

  I have a vague recollection of this topic being discussed before, but I couldn't
  find any references in my CLIM archives.  Does anyone know how to get the End
  key to work under CLIM 1.1 in Allegro CL 4.1?  Preferably on both the SPARC and
  SGI platforms.  The following code makes the End key work under both MCL and

  (in-package "CLIM")

  ;;; Enables the given character to serve as an activation character and
  ;;; to invoke COM-EXIT-AVV as #\End does under Genera.  (Based upon the
  ;;; SYS:CLIM;CLIM;ACCEPT-VALUES.LISP from Genera 8.1.1.)

  (defun add-end-character (character)
    (pushnew character *standard-activation-characters*)
    (add-keystroke-to-command-table 'accept-values character
				    :command 'com-exit-avv
				    :errorp nil)

  ;;; The key labelled End generates the #\End character under MCL and
  ;;; LispWorks.

  #+(or MCL LispWorks)
  (add-end-character #\End)

  However, not only is there no #\End character in ACL, but it seems that the End
  key doesn't even generate a character visible from Lisp!  Given that #\c-d is a
  semi-standard Unix end-of-file marker, I would be happy if I could hack some
  sort of keymap somewhere so that the End key would generate a #\c-d character.
  Unfortunately, I'm fairly Unix-challenged.  Can one of you gurus please help?

CLIM 1.1 uses CLX to map from keysyms to characters. You can try something

(xlib::define-keysym #\c-d #xff57) ;; #xff57 is XK_End

However, I think that this might be a bad idea because you are implicitly
introducing a modifier (control) to an unmodified key. In fact this is the
reason that the standard keyboard remapping mechanism - xmodmap - won't
let you do this.

[In CLIM 2, this is not an issue because the :END gesture is defined and
the End key maps to this]

  On a related topic, how does one abort a running computation in ACL?  I see that
  the variable CLIM:*ABORT-CHARACTERS* contains the single character #\c-\z, but
  if I type (DOTIMES (N 100000) (* N N)) and then try to stop the loop, nothing
  happens until the loop finishes, at which time I see something like:

    Error:  Abort event #\CONTROL-\z seen.

  I'm wrapping CLIM::CATCH-ABORT-GESTURES around the top-level loop.

CLIM 1, doesn't handle asynchronous aborts. This default way in CLIM 2 to
get an asynchronous abort is with m-c-z

Colin Meldrum, Franz Inc.	1995 University Avenue, Suite 275         
colin@Franz.COM (internet)	Berkeley, CA 94704                       
uunet!franz!colin (uucp)	Phone: (510) 548-3600; FAX: (510) 548-8253


Main Index | Thread Index