[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#9751: 23.3; Alternative Keyboard Feature/Bug
From: |
Juri Linkov |
Subject: |
bug#9751: 23.3; Alternative Keyboard Feature/Bug |
Date: |
Thu, 20 Oct 2011 09:29:54 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (x86_64-pc-linux-gnu) |
> I guess we can use function-key-map instead, tho.
And `function-key-map' really works even for characters
with no modifiers (for the value `nil' below):
(let ((modifiers '(nil (control) (meta) (control meta)))
(map '((?ς . ?w) (?ε . ?e) (?ρ . ?r) (?τ . ?t) (?υ . ?y)
(?θ . ?u) (?ι . ?i) (?ο . ?o) (?π . ?p) (?α . ?a)
(?σ . ?s) (?δ . ?d) (?φ . ?f) (?γ . ?g) (?η . ?h)
(?ξ . ?j) (?κ . ?k) (?λ . ?l) (?ζ . ?z) (?χ . ?x)
(?ψ . ?c) (?ω . ?v) (?β . ?b) (?ν . ?n) (?μ . ?m) (?\; . ?q))))
(dolist (pair map)
(dolist (mod modifiers)
(define-key local-function-key-map
(vector (append mod (list (car pair))))
(vector (append mod (list (cdr pair))))))))
So `C-χ β' runs `switch-to-buffer' whereas self-inserting characters
are inserted as is, without translation.
However, there is another problem. Single-key bindings don't work in modes
where they are bound to other commands, like `v' (`dired-view-file') in Dired,
or `d' (`Info-directory') in Info.
I see no better way than to translate single keys in such modes individually:
(let ((map '((?ς . ?w) (?ε . ?e) (?ρ . ?r) (?τ . ?t) (?υ . ?y)
(?θ . ?u) (?ι . ?i) (?ο . ?o) (?π . ?p) (?α . ?a)
(?σ . ?s) (?δ . ?d) (?φ . ?f) (?γ . ?g) (?η . ?h)
(?ξ . ?j) (?κ . ?k) (?λ . ?l) (?ζ . ?z) (?χ . ?x)
(?ψ . ?c) (?ω . ?v) (?β . ?b) (?ν . ?n) (?μ . ?m) (?\; . ?q))))
(dolist (pair map)
(define-key dired-mode-map (vector (car pair)) (vector (cdr pair)))
(define-key Info-mode-map (vector (car pair)) (vector (cdr pair)))
;; and many other similar modes ...
))
And then some single keys work, some don't. For example, typing a key
that translates to `x' in Dired writes in the echo area:
Keyboard macro terminated by a command ringing the bell
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Nikos Pitsianis, 2011/10/14
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Juanma Barranquero, 2011/10/14
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Nikos Pitsianis, 2011/10/14
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Eli Zaretskii, 2011/10/14
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Nikos Pitsianis, 2011/10/14
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Stefan Monnier, 2011/10/14
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Juri Linkov, 2011/10/19
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Stefan Monnier, 2011/10/19
- bug#9751: 23.3; Alternative Keyboard Feature/Bug,
Juri Linkov <=
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Stefan Monnier, 2011/10/20
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Juri Linkov, 2011/10/21
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Stefan Monnier, 2011/10/21
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Juri Linkov, 2011/10/22
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Stefan Monnier, 2011/10/23
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Andreas Schwab, 2011/10/23
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Stefan Monnier, 2011/10/23
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Juri Linkov, 2011/10/24
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Stefan Monnier, 2011/10/24
- bug#9751: 23.3; Alternative Keyboard Feature/Bug, Juri Linkov, 2011/10/24