- From: Henri Lesourd <address@hidden>
- To: address@hidden
- Cc: address@hidden
- Subject: Re: [TeXmacs] Changing F9-F12 keys for presentation mode
- Date: Sat, 12 May 2007 12:21:19 +0200
Philip Welch wrote:
Dear Henri,
Thanks very much for that. I like TeXmacs very much, but i am very much
a beginner.
I think I have got that sorted out (at least on one machine, on the
other I cannot get
the Example1 program to initialize - anyway that is a side issue).
The solution to such problems is usually destroy your .TeXmacs, start
TeXmacs once,
exit, and then reinstall your things inside the new .TeXmacs.
My problem now is that the arrow keys that I need to use in the kbd
assignment are also
being assigned their normal function elsewhere. The latter seems to
override whatever I put into
your Example1.
Where/how can I find where this is going on?
This is a known problem. You can use the following code :
[[
;; Permanent key mappings
(define-public kbd-map-old kbd-map)
(define kbd-map-looping #f)
(define-public-macro (kbd-map . l)
`(begin
(kbd-map-old . ,l)
(if (not kbd-map-looping)
(begin
(set! kbd-map-looping #t)
(always-key-mappings)
(set! kbd-map-looping #f)))))
(define (always-key-mappings) (lambda () #t))
(define always-key-mappings0 always-key-mappings)
(define keyboard-extend-forever-nb 0)
(define-macro (keyboard-extend-forever . body)
(define akm0 "")
(define akm1 "")
(set! akm0 (string->symbol (string-append "always-key-mappings"
(number->string keyboard-extend-forever-nb))))
(set! keyboard-extend-forever-nb (+ keyboard-extend-forever-nb 1))
(set! akm1 (string->symbol (string-append "always-key-mappings"
(number->string keyboard-extend-forever-nb))))
`(begin
(define-public (,akm1)
,(cons 'kbd-map body)
(,akm0))
(set! always-key-mappings ,akm1)))
]]
, and then use (keyboard-extend-forever ...) instead of (kbd-map ...)
in order to force your keyboard mapping to remain the active one in
case you are conflicting with some previous TeXmacs kbd mapping
somewhere.
Best, Henri
Archive powered by MHonArc 2.6.19.