Hi, Stephen.
On Fri, Jul 29, 2011 at 12:58:26PM +0900, Stephen J. Turnbull wrote:
Alan Mackenzie writes:
> I would like to put functions into function-key-map as the
bindings of a
> key sequence, something like:
> (define-key function-key-map [?\e ?\[ ?1 ?}]
'kn-prefix-control)
> , the intention being that on receiving the key sequence ESC [
1 },
> the control modifier will be added to the next key received.
No, this doesn't work. In XEmacs, function-key-map doesn't
call any
Lisp, it's a pure substitution of keystrokes for keystrokes. (More or
less.)
Oh, that's a shame.
> If there isn't the possibility of functions here, is there
some
> other way to do what I want?
The only thing I can think of is to bind ESC [ 1 } to a function
that
reads a key, modifies the event to add the control modifier, and
stuffs the key back in the event queue.
Maybe, I'll think about this.
What's the use case? Some kind of accessibility code?
My (tty) keyboard uses such codes for things like C-up. It would be much
nicer to be able to write
(global-set-key [(control up)] 'previous-line-6n)
than
(global-set-key [(meta \[) \1 } up] 'previous-line-6n)
. Or I could write a macro to place the entire key events into
function-key-map.
--
Alan Mackenzie (Nuremberg, Germany).
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta