From: Francis Leboutte

Subject: Re: [Q] Defining keystrokes

Date: 1997-6-26 8:34

At 11:53 26/06/97 +0100, Stefan Bamberger wrote:
> >I would like to define my own keystrokes for several function keys (i.e. >vk-f8, etc.) > >I tried to set it with > >(comtab::set-event-function top:*toploop-comtab* > '((pc::vk-f8)) > .... >) > >but the menu associated with that key always wins! Naively, I think, that >the last definition should supersede.
You have to remove the synonym, before to set the comtab, e.g.: (setf (menu-item-event-synonym ; = F7 (find-named-object :breakpoint (find-named-object :tools *lisp-menu-bar*)) ) nil) Notice you may define a keyboard accelerator with add-global-keyboard-accelerator. Here is a useful macro: ;;; to be used with add-global-keyboard-accelerator to restrict the ;;; keyboard accelerator scope to a window and its child windows (defmacro with-restricted-scope ((&key (window (get-focus *screen*)) (scope *lisp-main-window*)) &body body) `(cond ((find-stream :scope ,scope :pred #'(lambda (stream) (eq stream ,window))) <body at ,> T) (T NIL))) e.g. (add-global-keyboard-accelerator PC:VK-F1 '(lambda (window) (with-restricted-scope () (select-previous-lisp-editor-window)))) Francis -- Francis Leboutte, Algorithme, Rue de la Charrette 141, 4130 Tilff, Belgium <skynet.be at f.leboutte> <acm.org at leboutte> http://users.skynet.be/algo t&fax: +32-(0)4-388.35.28