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

Re: Using .XCompose



I have cat /etc/default/keyboard

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS="lv3:ralt_switch,compose:caps,terminate:ctrl_alt_bksp"
BACKSPACE="guess"

On Sun 12 Jul 2020 at 14:51:33 (+0000), Ajith R wrote:

> Using Konsole from my home directory
> 
> 1)executed setxkbmap -layout us
> 2)executed xmodmap which gave the following output
> 
> xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):
> 
> shift       Shift_L (0x32),  Shift_R (0x3e)
> lock        Caps_Lock (0x42)
> control     Control_L (0x25),  Control_R (0x69)
> mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
> mod2        Num_Lock (0x4d)
> mod3      
> mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
> mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

As expected from /e/d/k at the top, mine has slight differences:

xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

but note that all my whitespace is spaces, whereas yours has a
0xc2 0xa0 sequence preceding each space.

> 3)executed xmodmap -pk > xmm
> 
> The file named xmm is attached

Again, very similar to mine. The only different lines are:

- 22 0xff08 (BackSpace) 0xff08 (BackSpace) 0xff08 (BackSpace) 0xff08 (BackSpace) 0x0000 (NoSymbol) 0x0000 (NoSymbol) 0xfed5 (Terminate_Server)
+ 22 0xff08 (BackSpace) 0xff08 (BackSpace) 0xff08 (BackSpace) 0xff08 (BackSpace)

- 66 0xff20 (Multi_key) 0xff20 (Multi_key) 0xff20 (Multi_key) 0xff20 (Multi_key)
+ 66 0xffe5 (Caps_Lock) 0x0000 (NoSymbol) 0xffe5 (Caps_Lock)

- 108 0xfe03 (ISO_Level3_Shift) 0x0000 (NoSymbol) 0xfe03 (ISO_Level3_Shift)
+ 108 0xffea (Alt_R) 0xffe8 (Meta_R) 0xffea (Alt_R) 0xffe8 (Meta_R)

My (-) lines show the results of the three XKBOPTIONS in /e/d/k.
(I have compressed the whitespace here.)

Note that the whitespace in your *attached* file (mixed tabs and
saces) matched my own, whereas the file here in your post does not.
That suggests that the 0xc2 0xa0 sequences may be a result of your
copy/paste operation.

> 4) executed setxkbmap -print which gave the following 
> 
> xkb_keymap {
>         xkb_keycodes  { include "evdev+aliases(qwerty)" };
>         xkb_types     { include "complete"      };
>         xkb_compat    { include "complete"      };
>         xkb_symbols   { include "pc+us+inet(evdev)"     };
>         xkb_geometry  { include "pc(pc104)"     };
> };

xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us+inet(evdev)+level3(ralt_switch)+compose(caps)+terminate(ctrl_alt_bksp)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

again just reflects the additions in my /e/d/k.

> 5) execute grep $'\x00A0' .XCompose.

That's not going to work, on two counts. Firstly, $'\x00' is NUL,
which terminates the string, so grep $'\x00efghijkl' will give
the same result as grep $'\x00'. Secondly, \x should be followed
by only two characters, so grep $'\xc2\xa0' will reveal those
lines with odd whitescape. However, grep $'\xa0' will find them too.

BTW, C2A0 is UTF-8 for the Unicode codepoint \xa0, the unbreakable space.
So if you want to show the contents of a file, it might be better to
do it by incluing the file with your email editor. The output of
commands can be inserted by redirecting the output to a temporary
file and the included likewise.

> I noticed that there is $ sign before the search string, which I couldn't understand. I removed it and re-executed the new grep command grep '\x00A0' .XCompose. Now it doesn't return the line

… because it doesn't contain any lines with \x00A0 in them.

$ man bash

[ snip to line 516 ]

  Words of the form $'string' are treated specially. The word expands
  to string, with backslash-escaped characters replaced as specified
  by the ANSI C standard. Backslash escape sequences, if present, are
  decoded as follows:
  […]
  \xHH   the eight-bit character whose value is the hexadecimal value
         HH (one or two hex digits)
  \uHHHH the Unicode (ISO/IEC 10646) character whose value is the
         hexadecimal value HHHH (one to four hex digits)

So you were mixing up those two constructions, perhaps.

> Is it safe to say that the .XCompose file doesn't have the nonbreaking spaces?

If you haven't got it, install the package bsdmainutils which contains
the hexdump command. hexdump -C filename   will reveal exactly what's
in a file, hex to the left, and corresponding characters to the right.
(I alias "hex" to hexdump -C.)

> BTW, I understand that OP refers to me; but, what exactly does it stand for? Original Petitioner?

Original Post(er). Both post and person: which one is usually
obvious from the context.

> > So those examples, fi and ½, illustrate the difference between
> > modification on output and input in English. I can't judge how the OP
> > views this, nor whether they are contravening some conventions in
> > their own computer culture by trying to make their changes. This
> > doesn't even address how a computer responds to a command line
> > written in non-latin script.
> 
> I am concerned with the internal representation only. That is, I want <U0D19> to be replaced with <U0D19> < U0D4D> <U0D19>. The display of this sequence as a ligated conjunct or as three different symbols is dependant on the font the user has. Whether this sequence is displayed as the ligated conjunct or as three different charcters, it would be read the same. So, there isn't breaking of any langauge semantics  or conventions. All this would bring is some ease of typing a commonly used conjunct.

OK. I wonder whether the problem you're having with using XCompose
is that although those three characters <U0D19> <U0D4D> <U0D19>
look independent of each other in the file, the keystrokes that
generate them might not be. Not having your layout, I don't think
I can test whether you get the behaviour I think you do, that
when you put the cursor at the beginning of a *typed* line that
looks like the next one and press Delete once:
ങ്ങ
you get
ങ
whereas I get
്ങ
Is that right?¹ If so, there must be some extra logic built into the
keyboard mapping to achieve that effect. Perhaps this is interfering
with XCompose. Or possibly, because of the standard way in which the
keyboard is set up for all Indic scripts, XCompose just isn't
supported with that layout, as you have no need to compose characters
in the way that's needed for Latin scripts.

> > I know knothing about DE menus.
> > It would appear from others' posts that DEs can change anything
> > and everything.
> 
> What does DE stand for?

Desktop Environment. They seem to change the way most things are configured.

¹ This might only happen when you're typing input, not editing a file.

Cheers,
David.


Reply to: