help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switching non-English keyboard layouts and using Emacs shortcuts


From: Yuri Khan
Subject: Re: Switching non-English keyboard layouts and using Emacs shortcuts
Date: Wed, 13 May 2015 15:02:43 +0600

On Wed, May 13, 2015 at 10:35 AM, Shakthi Kannan <shakthimaan@gmail.com> wrote:

> I am using GNU Emacs 24.3.1 on Ubuntu 14.10. I use the following to
> switch between Dvorak and Tamil (native language) keyboard layouts
> respectively:
>
>   $ setxkbmap us -variant dvorak
>   $ setxkbmap -layout in -variant tam_unicode

You might prefer e.g. this:

$ setxkbmap us,in dvorak,tam_unicode grp:caps_toggle

This way, you will be able to switch layouts instantly by pressing
Caps Lock. See your /usr/share/X11/xkb/rules/evdev file for other ways
of switching groups if Caps Lock is precious to you.

> #2 How do other people who use non-English layouts use Emacs shortcuts
> with their native language input method?

I use this snippet which I lifted I don’t remember where:

===
(require 'cl)
(loop
  for from across
"\эуеицчксдзшщьяаожгтнвмюйыёфхпрлб\ЭУЕИЦЧКСДЗШЩЬЯАОЖГТНВМЮЙЫЁФХПРЛБ"
  for to   across
"\\wfpgjluy;[]arstdhneiozxcvbkm,./\\WFPGJLUY;[]ARSTDHNEIOZXCVBKM,./"
  do
  (eval `(define-key key-translation-map (kbd ,(concat "C-" (string from)))
                                         (kbd ,(concat "C-" (string to)))))
  (eval `(define-key key-translation-map (kbd ,(concat "M-" (string from)))
                                         (kbd ,(concat "M-" (string to)))))
  (eval `(define-key key-translation-map (kbd ,(concat "C-M-" (string from)))
                                         (kbd ,(concat "C-M-" (string to))))))
===

It is inelegant but makes life halfway bearable. (Non-C-M-modified
keys such as those in dired stay untranslated.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]