[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using AltGr as standard modifier key in emacs
From: |
Javier |
Subject: |
Re: Using AltGr as standard modifier key in emacs |
Date: |
Tue, 13 Oct 2015 18:19:36 +0000 (UTC) |
User-agent: |
tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (Linux/3.18.6-1-ARCH (x86_64)) |
> So my problem is not that I can not switch keyboard layout, the problem
> is that I want to have a working state which I can use 3rd level shift
> from inside Emacs input method or a workaround which give me ability to
> use Emacs keybindings (C- M- stuff) without changing keyboard layouts.
>From the elisp manual, you can use several modifiers keys: alt,
meta, hyper and super
http://www.gnu.org/software/emacs/manual/html_node/elisp/X11-Keysyms.html
http://www.gnu.org/software/emacs/manual/html_node/elisp/Other-Char-Bits.html
The X Window System defines three other modifier bits that can be
set in a character: hyper, super and alt. The syntaxes for these
bits are ???\H-???, ???\s-??? and ???\A-???.
So, for your question
> is there any way to work around this problem and assign a modifier key
> to "Right Alt Key" on keyboard which is accessible through elisp
> customization? something which I can assign a character (for example รก
> to (kbd rightalt-a))?
you can play with xmodmap to do this and remap rightAlt to Hyper or super
Typing this in a terminal should do the trick
xmodmap -e "keycode 108 = Hyper_L" ; xmodmap -e "add mod4 = Hyper_L"
You can check inside emacs that things are working by using C-h l (view lossage)
If it is mapped ok, pressing RighAlt-a you should see
H-a C-h l
Once this works you can customize RightAlt-a in elisp as
(kbd "H-a")
(kbd "s-b")
For hyper is a capital 'H' and for super it would be lower case 's'.
This might have some problems, like the desktop capturing the Hyper-a
combination.
What desktop are you using? gnome? kde?
Another problem would be that applications outside emacs might not be
able to use rightAlt anymore. That might still be solved running
emacs inside an X-server of its own.