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

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

Re: X keyboard settings (was keyboard macro)


From: Jürgen Sauermann
Subject: Re: X keyboard settings (was keyboard macro)
Date: Thu, 24 Oct 2013 12:35:23 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Rustom Mody <rustompmody <at> gmail.com> writes:

> 
> On Monday, October 21, 2013 11:47:30 PM UTC+5:30, Yuri Khan wrote:
> > On Mon, Oct 21, 2013 at 11:35 PM, Christof Spitz  wrote:
> > 
> > > I have to write special characters for transliteration of a non-european
> > > language (devanagari) in Emacs. 
> 
> > It never ceases to amaze me how far people are willing to go just to
> > avoid using an appropriate OS-level keyboard layout. In your case,
> > probably, the command “setxkbmap -layout "us,in" -variant ",deva"
> > -options "grp:caps_toggle,grp_led:caps"” will help a lot.
> 
> Hey its great to hear of this!
> Ive been trying to put together something for the new gnu apl that has
just been released.
> The author gives an xmodmap that works for apl but makes emacs close to
unusable -- Alt-x becomes an Apl char. 
> However all my attempts at wrapping my head round xmodmap have failed so far.
> Can setxkbmap replace xmodmap?
> 
> So far I found xkeycaps which seems to be such a replacement. When I use
it and try to save the map it segfaults 
> 
> 

Hi,

given Yuri's equivalence of xmodmap and setxkbdmap, and the segfault on
setxkbdmap, the way to go seems to be xmodmap.

xmodmap is actually fairly simple. Every key on your keyboard sends
a keycode between 1 and 255. You can use the program xev to show the
keycodes sent by the different keys.

For each keycode there is a line in the file given to xmodmap that
starts with "keycode = " followed by the keycode in question.

After the keycode come 0 to 8 values that are sent; which one is
determined by the state of the "modifier Keys", typically Shift,
Ctrl, and Alt. If no value is given for a particular state then nothing
is sent (i believe).

If you interpret the values as an 8x255 matrix then the first column is
the number (Unicode if the encoding is set to unicode) sent for each
key without modifier, the second column is the number sent when SHIFT
is down, third column when alt is down, fourth column when SHIFT and ALT
are down. I believe that columns 5 to 8 are the numbers like for 1 to 4
when the CTRL key is also down (have not tried that, though).

In this context, SHIFT, ALT, and CTRL means those keys that you have
decided (in the xmodmap file) to be SHIFT, ALT, and CTRL.

Now suppose you want to move all APL keys from the the ALT plane to the
CTRL plane. There are basically two different ways:

1. You exchange the ALT and CTRL keys in the xmodmap file,
   leaving all other keys intact, or

2. You insert some more columns (by writing NoSymbol entries)
   before the APL chars thius moving them from the ALT plane
   (column) to the CTRL plane.

If emacs uses xmodmap (I dont know that) then method 1. moves the
ALT keys used by emacs to the CTRL plane (which is probably not what
you want); in theat case you are better off moving only those "APL keys"
that conflict with emacs to either SHIFT+ALT or CTRL or whatever.

If emacs uses the keycodes directly (bypassing the xmodmap settings) then
method 1 is less work to do.


⍝ Jürgen










reply via email to

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