unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* keyboard translate
@ 2006-01-07 15:17 Emabela
  2006-01-07 15:44 ` thomas
  0 siblings, 1 reply; 4+ messages in thread
From: Emabela @ 2006-01-07 15:17 UTC (permalink / raw)







Hello Everybody,

 

 After solving the my previous question

 (how to insert unicode char -> ucs-insert),

 there is another problem:

 

 I successfully defined the following key:

 (define-key text-mode-map "\M-[" (lambda () (interactive nil)(ucs-insert "
0170")))

 and it works. 

But the [home] is lost:

the home key produces ESC [ 1 ~ and is not recognized.

I tried 

(define-key function-key-map "\e[1~" [home])

but it has no effect, and 

(keyboard-translate "\e[1~" "[home]")

but it is syntactically wrong.



Any idea?



TERM=screen and emacs is 21.4.1



Thanks for any help.

(I am sorry to disturb you with such stupid questions,

but I have difficulties in configuring emacs...)



Regards,

Bela



--------------------------Hirdetés-----------------------------

VÁLTSON SZÉLESSÁVRA 2006-BAN!

Kedvező árak, forgalomkorlátlan használat, és vilámgyors kiép
ítés.

Ne várjon tovább, jobbat úgysem talál!

Klikk ide: http://www.vipdsl.hu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: keyboard translate
  2006-01-07 15:17 keyboard translate Emabela
@ 2006-01-07 15:44 ` thomas
  0 siblings, 0 replies; 4+ messages in thread
From: thomas @ 2006-01-07 15:44 UTC (permalink / raw)


On 1/7/06, Emabela <emabela@vipmail.hu> wrote:
> the home key produces ESC [ 1 ~ and is not recognized.
> I tried
> (define-key function-key-map "\e[1~" [home])
> but it has no effect

This is my .emacs and it solved the problem for me, try to adapt it :
(if window-system
    (set-terminal-coding-system 'iso-8859-15-unix)
    (set-keyboard-coding-system 'iso-8859-15-unix)
    (set-language-environment 'Latin-9)
    (define-key function-key-map "\e[7~" [home])
    (define-key function-key-map "\e[8~" [select])
    (define-key function-key-map "\e[7^" [ctl_home])
    (define-key function-key-map "\e[8^" [ctl_select])
    (global-set-key [select] 'end-of-line)
    (global-set-key [home] 'beginning-of-line)
    (global-set-key [ctl_home] 'beginning-of-buffer)
    (global-set-key [ctl_select] 'end-of-buffer))

Regards

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: keyboard translate
       [not found] <mailman.261.1136647273.26925.help-gnu-emacs@gnu.org>
@ 2006-01-09  4:04 ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2006-01-09  4:04 UTC (permalink / raw)


>  (define-key text-mode-map "\M-[" (lambda () (interactive nil)(ucs-insert "
> 0170")))

> But the [home] is lost:
> the home key produces ESC [ 1 ~ and is not recognized.

M-[ (i.e. the [ key pressed with the meta modifier) is synonymous in Emacs
to ESC [ (at least unless you change the value of meta-prefix-char), so
you've added not just a binding to M-[ but also to ESC [.

Since the bindings in function-key-map are only used if the key would
otherwise be unbound, the translation of ESC [ 1 ~ into [home] is prevented
by your M-[ binding.


        Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Keyboard Translate
@ 2011-06-21 17:07 Valentin Plechinger
  0 siblings, 0 replies; 4+ messages in thread
From: Valentin Plechinger @ 2011-06-21 17:07 UTC (permalink / raw)
  To: Help-gnu-emacs

Hello,
I have some trouble with keyboard-translate

This is in my .emacs
...
(keyboard-translate ?\C-p ?\C-t)  ; translate 
(keyboard-translate ?\C-e ?\C-p)  ; translate 
(keyboard-translate ?\C-f ?\C-e)  ; translate 
...

The Problem is that this doesn't get evaluated when the emacs daemon starts, so I have to eval it by hand.
Also if I close the frame where my .emacs is opened after evaluating, it stops working and I have to evaluate my .emacs again. 
Which sucks... a lot...

Any clues how to solve this?

Cheers,
Valentin



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-21 17:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.261.1136647273.26925.help-gnu-emacs@gnu.org>
2006-01-09  4:04 ` keyboard translate Stefan Monnier
2011-06-21 17:07 Keyboard Translate Valentin Plechinger
  -- strict thread matches above, loose matches on Subject: below --
2006-01-07 15:17 keyboard translate Emabela
2006-01-07 15:44 ` thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).